The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 03-05-2007
moshe fried moshe fried is offline
Registered User
 

Join Date: Feb 2007
Location: Israel
Posts: 24
the problem is the input not the output

Since awk has limitations of the size of input it can take in one line try the following:
cat sql.txt | perl -e 'print (split (/#/,$_))[1]'
split works like the FS of awk, but the field count starts from 0
if you need a newline after the output use:
cat sql.txt | perl -e 'print (split (/#/,$_))[1] . "\n"'
Reply With Quote