Re: Help with script How to prepend 2 lines instead of 1

2011-01-21 Thread Rob Dixon
On 20/01/2011 19:10, steve1040 wrote: Using the script below I need to add a second line with the following text: "STAGEHDR|Barcoded" #!perl use strict; use warnings; my $file = 'path/to/Access.csv'; my $newline = "ENTHDR|1|3.0"; { local @ARGV = ($file); local $^I = '.bac'; while(<>

Re: Help with script How to prepend 2 lines instead of 1

2011-01-21 Thread Shlomi Fish
Hi Steve, On Thursday 20 Jan 2011 21:10:39 steve1040 wrote: > Using the script below I need to add a second line with the following > text: > "STAGEHDR|Barcoded" > > #!perl > use strict; > use warnings; > my $file = 'path/to/Access.csv'; > my $newline = "ENTHDR|1|3.0"; > { >local @ARGV = ($fi

Help with script How to prepend 2 lines instead of 1

2011-01-21 Thread steve1040
Using the script below I need to add a second line with the following text: "STAGEHDR|Barcoded" #!perl use strict; use warnings; my $file = 'path/to/Access.csv'; my $newline = "ENTHDR|1|3.0"; { local @ARGV = ($file); local $^I = '.bac'; while(<>){ if ($. == 1) { print "$new