awk: record too long


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers awk: record too long
# 1  
Old 06-13-2012
awk: record too long

Hi All ,
I am getting record too long for the below command .

Code:
nawk -F\" '{a[$1]=a[$1]" "$2} END{for(i in a) print i,a[i] }' test|sort|awk '{for(i=1;i<=NF;i++) t[i]=t[i]"\t"$i;if(NF>max)max=NF} END{for(i=1;i<=max;i++)print t[i] }'

File test has 850 records ...

Please help..

Last edited by joeyg; 06-13-2012 at 02:55 PM.. Reason: Please wrap data and sripts with CodeTags
# 2  
Old 06-13-2012
Hard to tell without seeing
sample data file
exact error message

By the way, confused about your test command, as part of
Code:
test|sort|awk

# 3  
Old 06-14-2012
That second awk should probably be nawk
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Long file record

riends I have the following problem: test.txt I have a file that has the following contents: is a fixed-length file to the end of the number 12 has spaces, so that it is fixed length 123456789 123456789 123456789 12 This code shows me the length of each record, but in... (2 Replies)
Discussion started by: tricampeon81
2 Replies

2. UNIX for Dummies Questions & Answers

sed and awk for long lines

Hi, I'm trying make a variable length file to a fixed length of 4000. I'm to pad spaces on the right of a record if length is less than 4000 to make the record length 4000. I'm trying to use the below commands awk '{printf "%-4000s\n", $0}' inputfile.dat > outputfile.dat sed -e :a... (12 Replies)
Discussion started by: uxusr
12 Replies

3. Shell Programming and Scripting

How to compare current record,with next and previous record in awk without using array?

Hi! all can any one tell me how to compare current record of column with next and previous record in awk without using array my case is like this input.txt 0 32 1 26 2 27 3 34 4 26 5 25 6 24 9 23 0 32 1 28 2 15 3 26 4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies

4. Shell Programming and Scripting

Record too long error while running awk

I have written below script to add substring in a file containing fixed length record, but when I run below script I get error as: ERROR: awk: record `22503004502488344040...' too long My fixed length record has length around 2000, each file is having 5000 records and total number of files is... (3 Replies)
Discussion started by: Devesh5683
3 Replies

5. Shell Programming and Scripting

Long lines in test.awk

I have a awk script called test.awk which I run using awk -f test.awk file1.txt > file2.txt I am doing a long print statement and want to put it in separate lines Do I need a '/' at the end or not????? Should it be like this print... (12 Replies)
Discussion started by: kristinu
12 Replies

6. Shell Programming and Scripting

Determine differient IP in a very long record.

Hi Everyone, I have a txt file with 40k lines. 111 1.1.1.1 111 1.1.1.1 111 2.2.2.2 111 1.1.1.1 111 1.1.1.1 How would use perl to easy have IP list, the final result will be: 1.1.1.1,2.2.2.2, I can only think using if to determine one by one through all 40k, this is working, but... (10 Replies)
Discussion started by: jimmy_y
10 Replies

7. Shell Programming and Scripting

Split long record into csv file

Hi I receive a mainframe file which has very long records (1100 chars) with no field delimiters. I need to parse each record and output a comma delimited (csv) file. The record layout is fixed. If there weren't so many fields and records I would read the file into Excel, as a "fixed width"... (10 Replies)
Discussion started by: wvdeijk
10 Replies

8. Shell Programming and Scripting

line too long using awk or sed or tr

Goodmorning, I have MKS Toolkit (K-Shell) running on a windows server. On it I have a c program that in a true unix environment works fine, but here it adds an extra '0000000000000016000A' in various places in the file that the c program produces that I need to remove. Here is what the file... (3 Replies)
Discussion started by: philplasma
3 Replies

9. Shell Programming and Scripting

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}'... (2 Replies)
Discussion started by: venkatajay_18
2 Replies

10. UNIX for Dummies Questions & Answers

Record too long for awk

I am trying to generate a small report with the help of awk. The contents are present in a file whose last line is very long. I can't shorten this line as its generated after a lot of processing. On reading this file awk says record "starting of line ..." too long record number 30 Now... (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies
Login or Register to Ask a Question