Re: awk like question

2004-08-13 Thread Gabor Urban
On Wed, 2004-08-11 at 16:08, [EMAIL PROTECTED] wrote: You can do it in awk and translet it to perl with a2p > All, > > wasn't sure if this was received b/c I got a reurne to sender error. > > > How can I print certain fields delimited by ' '? > In awk I would write awk '{print $1, $6}' filenam

RE: awk like question

2004-08-13 Thread Thomas Bätzler
<[EMAIL PROTECTED]> asked: > How can I print certain fields delimited by ' '? > In awk I would write awk '{print $1, $6}' filename In Perl, that would be perl -lane 'print "$F[0] $F[1] $F[5]"' filename See the perlrun manpage about all of the command line switches. Here I use -e - run P

Re: awk like question

2004-08-13 Thread John W. Krahn
[EMAIL PROTECTED] wrote: All, Hello, wasn't sure if this was received b/c I got a reurne to sender error. How can I print certain fields delimited by ' '? In awk I would write awk '{print $1, $6}' filename The Perl equivalent of that is: perl -lane 'print "@F[0,5]"' Here is an out file that I wan

Re: awk like question

2004-08-13 Thread DBSMITH
; <[EMAIL PROTECTED]> 08/13/2004 08:51 AM To: Perl Beginners <[EMAIL PROTECTED]> cc: Subject:Re: awk like question [EMAIL PROTECTED] wrote: > All, Hello, > wasn't sure if this was received b/c I got a reurne to sender error. >

Re: awk like question

2004-08-13 Thread Errin Larsen
gt; local $, = "\t"; > print FOO +(split)[0,1,5], $/; > #print +(split)[0,1,5], $/; > > Derek B. Smith > OhioHealth IT > UNIX / TSM / EDM Teams > 614-566-4145 > > "John W. Krahn" <[EM

Re: awk like question

2004-08-13 Thread Jeff 'japhy' Pinyan
On Aug 13, Errin Larsen said: >um, can anyone explain the 'print' function below to me? > >specifically ... this: > > 'print "@F[0,5]"' perldoc perlrun The @F array is created when the -a commandline switch is used in conjunction with -n or -p. Read 'perlrun' to find out more. -- Jeff "jap

Re: awk like question

2004-08-13 Thread Jose Alves de Castro
t +(split)[0,1,5], $/; > > > > Derek B. Smith > > OhioHealth IT > > UNIX / TSM / EDM Teams > > 614-566-4145 > > > > "John W. Krahn" <[EMAIL PROTECTED]> > > 08/13/2004 08:51 AM > > > > To: Perl Beginners <[EM

Re: awk like question

2004-08-13 Thread Jose Alves de Castro
t; > ## look for 9840S and ebexpire > > > > ## declare OFS = tab > > > > ## tell split to split on IRS 0,1&5. very similar to awk > > > > print $ > > > > > > > > if (($

Re: awk like question

2004-08-13 Thread Errin Larsen
xpire > > > ## declare OFS = tab > > > ## tell split to split on IRS 0,1&5. very similar to awk > > > print $ > > > > > > if (($_ =~ /9840S/) && ($_ =~ /ebexpire, ebexpire/ )) { > > >

Re: awk like question

2004-08-13 Thread David Greenberg
t; > while () { > > > > > > > > ## look for 9840S and ebexpire > > > > ## declare OFS = tab > > > > ## tell split to split on IRS 0,1&5. very similar to awk > > > > print $ > >

RE: awk like question

2004-08-13 Thread Bob Showalter
Errin Larsen wrote: > ok. I'm not getting my question across clearly. Let me try again. > > I have a collection of data in a text file. Here is an example: > > ## foobar.txt ## > one two three > A B C > yes nomaybe > > In a script (not on the command line) I want to be able to