[plug] Extreme text editing

J Michael Gilks mike at gilks1.com
Wed Oct 8 16:52:57 WST 2003


On Wed, 8 Oct 2003 07:32 am, Jens Porup wrote:
>
> In Perl:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> open BIGFILE, "<testfile.txt" or die "couldn't open my big text file!\n";
> open NEWFILE, ">outputfile.txt" or die "couldn't open the output file!\n";
>
> while (<BIGFILE>)
> {
> 	#$. is a special Perl variable that contains the line number
>     s/FOO/BAR/ if ( $. == 10557152 );
>
> 	#print to a second file, just in case
> 	print NEWFILE;
> }
>
> Cheers,
>
> Jens
>
Did try this, nice little bit of code isn't it. Unfortunately perl choked and 
said input file too big.
Probably something to do with the installation.

Love Mike.
_______________________________________________
plug mailing list
plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug


More information about the plug mailing list