search replace retain and compare strings?



I have lines like:

$PSTIL,IRQ, 48 bytes
9,9,IDLE,0,0,CC,0,0,MC,1,1,NF,2,2,CD,2,0,AI,1,1,LP,81,83*09

$PSTIL,IRQ,9,9,IDLE,0,0,CC,0,0,MC,1,1,NF,2,2,CD,2,0,AI,1,1,LP,81,83*09

$PSTIL,IRQ,9,37 bytes
9,IDLE,0,0,CC,0,0,MC,1,1,NF,2,2,CD,2,0,AI,1,1,LP,81,83*09

I need to remove these 37 and 48 bytes text from these lines and print
the remaining string to another file. Also I need to check for any
newline characters in the end of every line.

Finally I need to compare each of these line with another file that
also has a similar output and report if any discrepancy exists.
Note: i dont have commas in few lines....so i am unable to split with
commas.

also i am using s/^*.* Bytes*.*//g expression, doesn;t serve the
purpose
Can anyone help in this.

Thanks,
Bala

.



Relevant Pages

  • RE: Help with replacement pattern
    ... replace the commas which are not contained within a pair of quotes. ... After all the "" pairs are matched, any commas in the remaining string ... bool isInQuotes = false; ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Text file I/O in VBA
    ... the commas are also handled well into your cleaned ... Dim f1 As Integer ... Dim fInput As String ... Input #1, strLIne ...
    (microsoft.public.access.modulesdaovba)
  • Re: Format a sorted character string
    ... What string did you start with when you got a blank string returned? ... And if you look at the code, it changes commas to spaces, then fixes the spaces, ... Sub testme() ... Dim myStr As String ...
    (microsoft.public.excel.programming)
  • Re: split parameter line with quotes
    ... i'm looking for some way to split up a string into a list of pairs ... The problem is that you are using commas for delimiters at two ... some other delimiter, ... through each character and keep a count of quotation marks. ...
    (comp.lang.python)
  • RE: Lookup email addresses for programmed email report
    ... BTW, if you use commas to separate the list, you are ... Dim EMailList as String ... DoCmd.SendObject acSendReport, "Surety Release Request", acFormatSNP, _ ... I used DFirst assuming that there is only a single record in the tblEmail ...
    (microsoft.public.access.modulesdaovba)