06-08-2012
Im maybe missing something here... One record is made of 9 lines, is that so? and you need to collect data from the first second and sixth no?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everyone, happy new year!
Can someone teach me how I can print the last 2 fields of every line in a file (lines don't have uniform number of fields), for example:
input file:
aaa bbb ccc ddd
eee fff ggg
hhh iii jjj
kkk lll mmm nnn ooo
output:
ccc ddd
fff ggg
iii jjj
nnn ooo
... (2 Replies)
Discussion started by: Deanne
2 Replies
2. 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
3. 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
4. Shell Programming and Scripting
HI,
I am using below command to display the words, but i am getting awk error. Please help me out on this
I am using below code
i am getting error as
If i use below code i am getting below OP
Output from where i am trying to select the fields after delimiter ","
from here i want to... (5 Replies)
Discussion started by: darling
5 Replies
5. Shell Programming and Scripting
Hi Friends,
I'm facing an issue. I am having a file as under :
a1
b1
c1
a2
a3
a4
b4
a5
b5
and I need to get the output as under:
a1 b1
a4 b4
a5 b5
i.e. to pick the columns where a and b are consecutive and ignoring rest.
I was trying some thing sily as: (2 Replies)
Discussion started by: vanand420
2 Replies
6. 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
7. 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
8. 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
9. Shell Programming and Scripting
The below code works great, kindly provided by @Don Cragun, the lines in bold print the current output. Since some of the fields printed can be blank some of the fields are shifted. I can not seem too add . to the blank fields like in the desired output. Basically, if there is nothing in the field... (10 Replies)
Discussion started by: cmccabe
10 Replies
10. UNIX for Beginners Questions & Answers
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies