10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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. UNIX for Dummies Questions & Answers
Hi All ,
I am getting record too long for the below command .
nawk -F\" '{a=a" "$2} END{for(i in a) print i,a }' test|sort|awk '{for(i=1;i<=NF;i++) t=t"\t"$i;if(NF>max)max=NF} END{for(i=1;i<=max;i++)print t }'
File test has 850 records ...
Please help.. (2 Replies)
Discussion started by: saj
2 Replies
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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