Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text file is truncated while using sed,grep,cut

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a problem dealing with a file having a long row.

I am trying to extract a portion of a row using unix commands. But the output is being truncated after about 1060 bytes.

Is there a limitation on the number of bytes per line?

Is there a parameter I need to setup at unix level?

Here is the command I used....

grep "Stmt=" $trace_file_name | cut -d'=' -f4-|sort |uniq -c|sort -k 1 > "$trace_file_base_name"_sql_count.out

Some rows are of 4000 and 6000 bytes size. When used above command, the text at the right side is being truncated after about 1060 bytes.

Any kind of tips will be useful.

Thanks in advance.

Jay
jayagopal@hotmail.com
 
Hi, from looking at the man page for cut, if you use cut with the -f switch, your input line is limited to 1023 characters.

I haven't tried this, but something like this may help ..

grep "Stmt=" $trace_file_name | awk '{print $2}' FS="=" |sort |uniq -c|sort -k 1 > "$trace_file_base_name"_sql_count.out

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top