Perl: parsing string enclosed by double quotes

Posted by sfactor on Stack Overflow See other posts from Stack Overflow or by sfactor
Published on 2010-12-21T14:41:34Z Indexed on 2010/12/21 14:54 UTC
Read the original article Hit count: 313

Filed under:
|
|
|

I need to parse tab/space delimited files that have a lot of columns in Perl. The values are such that the there are large strings enclosed within double quotes. These strings can have any characters such as tabs and spaces or anything else.

When I try to parse them with the split function it splits these strings as well. Now how can I make perl understand that the strings within the " " are a single column entry?

A simple example is,

12  345546.67677   "Hello World!!!" -567.55656 0.5465767 "Hello_Again;   "

© Stack Overflow or respective owner

Related posts about perl

Related posts about parsing