in reply to Insert blank rows in a CSV
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Insert blank rows in a CSV
by ArmandoG (Sexton) on Jan 09, 2008 at 18:56 UTC | |
But for example if I want to leave a few rows in blank because i need to put a image there, how can I do that but not from command line but from a program this is what I am trying to tell you So, Image I have already have it, but I cant tell the excel csv file to add rows How can i do that? thanks | [reply] [d/l] |
by runrig (Abbot) on Jan 09, 2008 at 19:48 UTC | |
| [reply] |
by pc88mxer (Vicar) on Jan 09, 2008 at 20:03 UTC | |
One nice property of this approach is that if your script bombs in the middle, you still have the original contents around. So, I hope this explains why you don't have to "reserve" space in your original file for the added content. On the other hand, if you want your original file to actually look like: and you want the script to replace with something, then that's a different problem, but you can still use the same idea: Use the above code with the -i option to use perl's file editing feature. If the rows you want to replace are blank, then just use line numbers as the matching criteria:
| [reply] [d/l] [select] |
by starX (Chaplain) on Jan 09, 2008 at 19:11 UTC | |
| [reply] [d/l] |
by ArmandoG (Sexton) on Jan 09, 2008 at 19:47 UTC | |
thanks | [reply] [d/l] |
by runrig (Abbot) on Jan 09, 2008 at 20:00 UTC | |
by starX (Chaplain) on Jan 09, 2008 at 20:04 UTC | |