10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Using the awk below I am able to combine all the matching dates in $1, but I can not seem to remove the non-matching from the file. Thank you :).
file
20161109104500.0+0000,x,5631
20161109104500.0+0000,y,2
20161109104500.0+0000,z,2
20161109104500.0+0000,a,4117... (3 Replies)
Discussion started by: cmccabe
3 Replies
2. Shell Programming and Scripting
Hi all , I have two files : dblp.xml with dblp records and itu1.txt with faculty members records. I need to find out how many dblp records are related to the faculty members. More specific: I need to find out which names from itu1.txt are a match in dblp. xml file , print them and show how many... (4 Replies)
Discussion started by: iori
4 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
Hello all,
simple matching and if not match problem that i can't figure out.
file1
hostname:
30 10 * * * /home/toto/start PROD instance_name1 -p
00 9 * * * /home/toto/start PROD instance_name2 -p
15 8 * * * /home/toto/start PROD instance_name3 -p
hostname2:
00 8 * * *... (5 Replies)
Discussion started by: maverick72
5 Replies
6. Shell Programming and Scripting
Hi Guys !
i want to search a record in file by matching two values in a record in two different columns
suppose i have 3 columns
and i want to select all those values from col1 for which in col3 has a specific value
e.g select all "john" from column1 where column 3 has a value of "20"
... (9 Replies)
Discussion started by: ourned
9 Replies
7. UNIX for Dummies Questions & Answers
Hi all !
I need your help as quick as possible.
My input file like this:
bạc těnh ( 薄情) 1 . 薄情な.2. 夫婦或いは男女の不貞を指す。
bách (百,迫)1.100ドソ. tr a m b a c ともいう. 2.柏(カヽしわ)・ 3.圧迫する.4.差し迫った,
My propose is take the value in the firt bracket. I used the command like :
...if (index(... (6 Replies)
Discussion started by: maixu134
6 Replies
8. Shell Programming and Scripting
I need help :)
I have two input files and I'd like to generate a report based on the two.
filea:
hostname,account1,password
,account2,password
hostname,account1,password
hostname,account1,password
,account1,password
,account2,password
repeating hostnames are blank
fileb:
hosta... (7 Replies)
Discussion started by: synmag
7 Replies
9. Shell Programming and Scripting
Hello:
I am trying to perform a certain action if the current record is the last line of the input file. But I am unable to figure out how to determine the last line of a file in awk.
I need to do something like this:
awk '{ if (lastline == NR) Do Something}' myfile.txt
I have tried the... (3 Replies)
Discussion started by: PacificWonder
3 Replies
10. Shell Programming and Scripting
Hi,
I'm trying this command - but get this error.
Do you guys have any workaround for this?
cat tf|sed 's/{//g'|sed 's/,//g'|awk '{for (i=1;i<=NF;i++) {if ($i == "OPTIME") {k = i + 2; print $i,$k}}}'
awk: record `2005 Jul 28 17:35:29...' has too many fields
record number 15
This is how... (3 Replies)
Discussion started by: chaandana
3 Replies