Hello All,
I'm just trying to get some ideas for the best way to approach this...
I have a CSV file whose first line is a header. According to this header
there should be 17 values per line. Unfortunately this is not the case.
It seems that the first 16 header values match up with the first 16
- Original Message -
From: RICHARD FERNANDEZ [EMAIL PROTECTED]
Newsgroups: perl.beginners
To: beginners@perl.org
Sent: Thursday, June 08, 2006 11:17 AM
Subject: parsing a CSV file with more fields than column names
Hello All,
I'm just trying to get some ideas for the best way
]
Sent: Thursday, June 08, 2006 8:18 AM
To: beginners@perl.org
Subject: parsing a CSV file with more fields than column names
Hello All,
I'm just trying to get some ideas for the best way to approach this...
I have a CSV file whose first line is a header. According to this header
there should
Hello Rich
Hi, Chris, thanks for your response
See docs for perlfunc, specifically split.
Especially, the form for split
'split /PATTERN/,EXPR,LIMIT'
By setting the limit, you will be able to solve the problem.
Chris
The thing is I can't be sure that there will never be
-Original Message-
From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 2:04 PM
To: beginners@perl.org
Subject: RE: parsing a CSV file with more fields than column names
Hello Rich
Hi, Chris, thanks for your response
See docs for perlfunc
Are you SURE that there might be commas in the other fields?
I would hope that whoever made this file you're parsing would
have thought of this if they ever intended to later use the data.
Good point. But I have no way of verifying that.
These CSV files are provided to me by an outside
-Original Message-
From: RICHARD FERNANDEZ [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 08, 2006 2:37 PM
To: beginners@perl.org
Subject: RE: parsing a CSV file with more fields than column names
Are you SURE that there might be commas in the other fields?
I would hope that whoever