10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello:
I want to print out the even number of fields plus the first column as row identifiers.
input.txt
ID X1 ID X2 ID X3 ID X4
A 700 A 1200 A 400 A 1300
B 2000 B 1000 B 2000 B 600
C 1400 C 200 C 1000 C 1200
D 1300 D 500 D 600 D 200and the output is:
output.txt
ID X1 X2 X3... (3 Replies)
Discussion started by: yifangt
3 Replies
2. Shell Programming and Scripting
Hi
I have a file as below
<field1> <field2> <field3> ... <field_num1> <field_num2>
Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields.
I tried this and it doesn't sort on the difference field .. Appreciate your help.
cat... (9 Replies)
Discussion started by: newstart
9 Replies
3. Shell Programming and Scripting
Hi experts,
I need to print the first field first then last two fields should come next and then i need to print rest of the fields.
Input :
a1,abc,jsd,fhf,fkk,b1,b2
a2,acb,dfg,ghj,b3,c4
a3,djf,wdjg,fkg,dff,ggk,d4,d5
Expected output:
a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies
4. Shell Programming and Scripting
Hi
file.in and file.out are in csv format. the code I have now is,
cat file.in | awk -F"," '!($1$2$3$4$5$6$7$8 in a){a;print $0}' > file.out
Here, I am printing entire line using $0. however, I want to print $1 to $150 and it should be in csv format. Cut -d is not good in performace.... (3 Replies)
Discussion started by: krishnix
3 Replies
5. Shell Programming and Scripting
How do I print all the fields of a record except for the $(NF) field? (4 Replies)
Discussion started by: locoroco
4 Replies
6. Shell Programming and Scripting
Hi,
i want to generate print statement using awk.
i have 20+ and 30+ fields in each line
Now its priting only first eight fields print statement as output not all.
my record is as shown below filename
... (2 Replies)
Discussion started by: raghavendra.nsn
2 Replies
7. Shell Programming and Scripting
format of file1 "file1.txt"
1 2 3 4
A B C
XX YY ZZ AA WWW
The output must contain except the first and last column
the output must be
2 3
B
YY ZZ AA (8 Replies)
Discussion started by: centurion_13
8 Replies
8. UNIX for Dummies Questions & Answers
Hello all,
Would appreciate if someone can help me out on the following requirement.
INPUT FILE:
--------------------------
TPS REPORT
abc def ghi
jkl mon pqr
stu vrs lll
END OF TPS REPORT
TPS REPORT
field1 field2 field3
field4 field5 field6 (8 Replies)
Discussion started by: hyennah
8 Replies
9. Shell Programming and Scripting
I've got a file with each record on a separate line and each record contains 34 fields separated by a colon and i'm trying to re-arrange the order of the fields and merge together certain fields separated by a slash (like field7/field28). I tried using an awk print statement like
awk -F: 'BEGIN... (5 Replies)
Discussion started by: RacerX
5 Replies
10. Shell Programming and Scripting
I am trying to print the output of a command to two separate files. Is it possible to use awk to print $1 to one file and $2 to another file?
Thanks in advance! (1 Reply)
Discussion started by: TheCrunge
1 Replies