YARQ - Yet another regex question

From: sjp (salvador_at_progressivetrail.org)
Date: 03/29/05


Date: Tue, 29 Mar 2005 18:37:50 GMT

Hi folks,

I'm parsing through a series of delimited records. Some of the records
use '\t' for the delimiter, and others use '=09' as the delimiter. My
program handles the tab-delimited records fine, but records that use '=09'
have erroneous line breaks after '=' signs, like so:

93=093=094/1/2004=09=09HARNEY=09JAMES=09808 SITKA AVE=09=09NEWBERG=09OR=099=
71320000=098.33=09I=09CA=09PARK RANGER=09=0966.64=09=09=09=09=09=09PARKS & =
RECREATION DIVISION=09

I'd like to remove the '=' and EOL, but 'Sline =~ s/\=\n//g;' fails with
an "Can't modify constant item in substitution (s///) at
/usr/local/bin/mailparse line 18, near "s/\=\n//g;" error

What is the proper way to do it?

Thanks,

SJP



Relevant Pages

  • Re: how do I paste or import without parsing??
    ... The parsing occurs when I open up a new worksheet and then paste from another ... Or when I drag a text file onto an open instance of Excel. ... delimiter. ... online help, but the online help regarding how to find the version number ...
    (microsoft.public.excel.misc)
  • Re: IO function in Vb.Net slower than in Vb6.0
    ... The fact that there is a record delimiter is a given because of the use of ... using regex on my workstation takes approx 73 seconds. ... Parsing the same file in a line by line read using the Trim and Mid ... Although it has been an interesting exercise, I don't think that regex is ...
    (microsoft.public.dotnet.languages.vb)
  • Re: fast text parsing
    ... Strings with regular expressions? ... splitting strings into arrays on a delimiter? ... It all 'depends' :-) If you're doing http header parsing, ... if you only need the data between two delimiter, ...
    (comp.lang.ruby)
  • Re: IFS and double quote in delimiter
    ... > i.e. double quote comma double quote ... > delimiter with a particular choice of IFS, ... Not with the shell's normal input parsing. ... characters; any character in it is treated as a delimiter. ...
    (comp.unix.shell)
  • Re first intials
    ... You'd be better off parsing the data with Text to Columns ... using either the "space" or "," (comma) delimiter. ... Biff ...
    (microsoft.public.excel.worksheet.functions)