See below the quoted text
On 02/03/2014 08:12 PM, SSC_perl wrote:
I'm having a problem with the script below. I want to alter just the first line
of a CSV file, removing the prefix "tag_" from each value in that line.
However, because the new line is shorter than the original, the sc
Thanks everyone. Both Tie::File and File::Slurp work nicely for this
purpose. Now comes the hard part - picking which one I want to use. ;)
Frank
http://www.surfshopcart.com/
Setting up shop has never been easier!
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additio
On Tue, 04 Feb 2014 11:59:30 +
Rob Dixon wrote:
> If it is satisfactory to leave the original file with trailing spaces
> at the end of the first line, then you can do so like this
>
> use strict;
> use warnings;
>
> my $filename = 'products.csv';
> open (my $fh, '+<', $filename) || die "ca
On 04/02/2014 01:12, SSC_perl wrote:
use strict;
use warnings;
my $filename = 'products.csv';
open (my $fh, '+<', $filename) || die "can't open $filename: $!";
my $line = <$fh>;
$line =~ s/tag_//gi;
seek $fh, 0, 0;
printf {$fh} $line;
close $fh;
If it is satisfactory to leave the original fil
On 02/03/2014 09:05 PM, Shawn H Corey wrote:
On Mon, 03 Feb 2014 20:50:17 -0500
Uri Guttman wrote:
Is there a way to replace the entire line with the new, shorter
one?
that is a unix problem and can't be done in any language.
It's not even a UNIX problem. Windows and BSD have it too. It is
On Mon, 03 Feb 2014 20:50:17 -0500
Uri Guttman wrote:
> > Is there a way to replace the entire line with the new, shorter
> > one?
>
> that is a unix problem and can't be done in any language.
It's not even a UNIX problem. Windows and BSD have it too. It is an
artifact of how files are create
On 02/03/2014 08:12 PM, SSC_perl wrote:
I'm having a problem with the script below. I want to alter just the
first line of a CSV file, removing the prefix "tag_" from each value in
that line. However, because the new line is shorter than the original,
the script is only over-writing part of the
I'm having a problem with the script below. I want to alter just the
first line of a CSV file, removing the prefix "tag_" from each value in that
line. However, because the new line is shorter than the original, the script
is only over-writing part of the original line (exactly the num