in reply to how to modify a field in a CSV file
#!/usr/bin/perl -w # Caveat: untested code. Don't do anything foolish with it. use strict; use Tie::File; tie my @ry,"Tie::File", "MyFile.csv" or die "MyFile.csv:$!"; my $i = 10; # or whatever my @j = split(",",$ry[$i]); $j[1] = "This is a fence"; $ry[$i] = join(",",@j); # #############################
Obviously you'd have to customize the above to suite your needs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to modify a field in a CSV file
by beerman (Novice) on Sep 02, 2011 at 17:57 UTC | |
by Eliya (Vicar) on Sep 02, 2011 at 18:32 UTC | |
by beerman (Novice) on Sep 02, 2011 at 20:25 UTC | |
by Tux (Canon) on Sep 02, 2011 at 22:21 UTC |