Re: printing fields without the use of awk

2003-02-27 Thread Stefan Lidman
#!/usr/bin/perl -w use strict; =pod Maybe somthing like this is what you want =cut open IN, "$ARGV[0]" or die "Damn $ARGV[0]: $!"; while (){ chomp; my @stats = split /\|/, $_; print "@stats\n" if $stats[2] and $stats[2] =~ /^\d+$/ and $stats[2] > 300; } close IN or die "Doh $!"; #

Re: printing fields without the use of awk

2003-02-27 Thread Aimal Pashtoonmal
Hi, sorry that print statement should read: "print "$payroll[1] $payroll[0]\n"; regards, aim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: printing fields without the use of awk

2003-02-27 Thread Aimal Pashtoonmal
Dear Mr Jackson, I am no perl expert, and I am sure other perl people will come up with another way- as there always is with perl, but it seems this print statement should do the trick (untested): "print "$payroll [1] $payroll [0]\n"; brady

Re: printing fields without the use of awk

2003-02-26 Thread R. Joseph Newton
brady jacksan wrote: > HI all, > > I am doing an assignment. I am writing a script to access a file and > print the first and last name of workers whose hours worked exceeded > 300hours. In the file, the last name is the first field and the first name > is the second field. Both fields are separa

printing fields without the use of awk

2003-02-26 Thread brady jacksan
HI all,I am doing an assignment. I am writing a script to access a file and print the first and last name of  workers whose hours worked exceeded 300hours. In the file, the last name is the first field and the first name is the second field. Both fields are separated by the "|" operator.#!/usr/bin/