in reply to Re: Removing everything before the first comma separator on each line of a text file
in thread Removing everything before the first comma separator on each line of a text file

That will remove all the comma's from the rest of the line.

It will also break if one of the fields is quoted and contains a newline.

Bad advice

update: The comma after $OFH will also cause havoc :P


Enjoy, Have FUN! H.Merijn
  • Comment on Re^2: Removing everything before the first comma separator on each line of a text file
  • Download Code

Replies are listed 'Best First'.
Re^3: Removing everything before the first comma separator on each line of a text file
by soonix (Chancellor) on Sep 16, 2014 at 07:37 UTC

    nope, split leaves the delimiters in after the LIMIT (just tested with perl 5.14.2).

    Admittedly, the documentation says "substrings (called "fields") that do not include the separator", so one could expect an implementation of split which filters out the delimiters from the "rest field", but I have heard the "P" in "Perl" stands for "practical" :-)

    your update about the comma after print$OFH is correct, of course...