
Chivalri
Novice
Aug 8, 2008, 12:02 PM
Post #2 of 3
(494 views)
|
|
Re: [raghunand] blank columns in csv
[In reply to]
|
Can't Post
|
|
a blank csv column should consist of two comma's next to each other with 0 or more spaces, so if you replace anything which matches that pattern (something like /,\s*,/ ) and replace it with a single comma, the blank will go away (shift the rest left). The major concern is if you have blanks in some rows which don't correspond to an entire column, then you'd also remove those as well and shift the row left. You could try running over the entire file once and have the program learn which columns are blank by checking the placement of blanks between rows. Hopefully that gives you some idea of how to proceed
|