packetstormer has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I am looking for some advice on the best method to use to make changes to a csv file. An few example lines of the source:
john smith,York,22,leaf,second,901,enter john doe,Oxford,45,elm,first,901,enter
I will need to enter the file (which may be quite big) and check, say, the fourth, fifth and sixth field in each line. Then if they match certain values, replace them with other values.
I am not looking for any code just advice on the best way to go about it. For example, I think I could easily ready each line into an array, run an if block and then use a regex to replace the values on a line by line basis. I am concerned that this may not be the best approach.
Any suggestions?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CSV Manipulation
by Tux (Canon) on Nov 16, 2011 at 16:12 UTC | |
Re: CSV Manipulation
by CountZero (Bishop) on Nov 16, 2011 at 19:19 UTC | |
by Tanktalus (Canon) on Nov 16, 2011 at 20:09 UTC | |
by Tux (Canon) on Nov 17, 2011 at 09:47 UTC | |
Re: CSV Manipulation
by jandrew (Chaplain) on Nov 16, 2011 at 16:44 UTC | |
Re: CSV Manipulation
by furry_marmot (Pilgrim) on Nov 16, 2011 at 19:17 UTC |
Back to
Seekers of Perl Wisdom