![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| 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 | 9 | 12-04-2008 04:04 PM |
| fl command - set record length | Tom Siegel | Shell Programming and Scripting | 2 | 07-17-2006 10:50 AM |
| fixed record length | george_ | Shell Programming and Scripting | 16 | 03-28-2006 06:41 AM |
| Record too long for awk | vibhor_agarwali | UNIX for Dummies Questions & Answers | 2 | 01-29-2005 03:14 AM |
| UNIX Default Record Length in AWK | JLandry | UNIX for Advanced & Expert Users | 1 | 01-25-2002 10:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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 |
|
||||
|
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"' |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|