Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Conditional continued matching with regexes

by almut (Canon)
on Feb 05, 2007 at 23:56 UTC ( [id://598455]=note: print w/replies, xml ) Need Help??


in reply to Conditional continued matching with regexes

Just another idea, which might or might not be applicable in your case.

I too once had the requirement to allow multiline entries (within one field). The CSV tables were written by Excel, so it was possible to set things up such that newlines within-field were \n Unix-style, while the row records were being separated by \r\n Windows-style newlines. That way, I could easily distinguish them, in order to read in one row at a time from the CSV file.

Not sure if you have control over how the CSV files are being generated, but if so, maybe you can arrange for something similar...

Also, personally, I'd use Text::CSV_XS (or some such) to properly split up fields, and then do my manipulations on them...   OTOH, I don't want to spoil your fun finding a nice regex solution :)

Replies are listed 'Best First'.
Re^2: Conditional continued matching with regexes
by bart (Canon) on Feb 06, 2007 at 14:49 UTC
    Not sure if you have control over how the CSV files are being generated, ...
    Just think: if I did have that kind of control, then wouldn't you expeect that I could take care of this kind of tweaks over there, too, so there wouldn't be any need to postprocess the CSV files, at all?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://598455]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-24 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found