loris has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I am using DBD::CSV to manipulate a csv-file. However, I now find that I need to add a column to the file. As DBD::CSV or rather SQL::Statement::Syntax does not seem to support ALTER TABLE, I'll have to change the csv-file directly.
I could just split the lines on the delimeter and add an extra delimeter at the appropiate place, but I thought it would be more snazy to use a regular expression. However, I haven't been able to find out how to specify the nth occurence of something.
Can anyone point me in the right direction?
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing nth occurrence of string
by graff (Chancellor) on Sep 23, 2005 at 14:34 UTC | |
by svenXY (Deacon) on Sep 23, 2005 at 15:11 UTC | |
by loris (Hermit) on Sep 23, 2005 at 20:47 UTC | |
|
Re: Replacing nth occurrence of string
by svenXY (Deacon) on Sep 23, 2005 at 13:02 UTC | |
by halley (Prior) on Sep 23, 2005 at 15:24 UTC |