![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What the command to find out the record length of a fixed length file? | tranq01 | UNIX for Dummies Questions & Answers | 3 | 10-19-2007 11:16 AM |
| fl command - set record length | Tom Siegel | Shell Programming and Scripting | 2 | 07-17-2006 06:50 AM |
| fixed record length | george_ | Shell Programming and Scripting | 16 | 03-28-2006 02:41 AM |
| Record too long for awk | vibhor_agarwali | UNIX for Dummies Questions & Answers | 2 | 01-28-2005 11:14 PM |
| UNIX Default Record Length in AWK | JLandry | UNIX for Advanced & Expert Users | 1 | 01-25-2002 06:40 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Record Length too long -- AWK Problem
Hi All,
I have a txt file which is an export of a query result from the database. The txt file contains 'Processid#sqlquery' from the database table.As the sqlquery is too long.... i am unable to get the fields seperated using the awk script as below:- cat sql.txt | awk -F'#' '{printf $2}' Error:- awk: record ` 16355#SELECT EDW_RE...' too long My objective is to have Processid as txt file name which contains that particular query. So for each row of Processid#sqlquery i shud be creating a processid file containing that particular sql. Please help me with ur suggestions!! Thanks, Ajay |
| Forum Sponsor | ||
|
|
|
|||
|
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"' |
|||
| Google The UNIX and Linux Forums |