9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file.
Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file.
script :... (3 Replies)
Discussion started by: Optimus81
3 Replies
2. Shell Programming and Scripting
I have text files, fields separated by commas, and there are 115 fields.
I need to use nawk to look at each line, if field $4==10, then count how many times the combination of field $5 and field $11 occur in the file.
I tried the following:
nawk -F, '{if($4==10){tg++;cd++,tgcd++}}END{for(i in... (3 Replies)
Discussion started by: he204035
3 Replies
3. Shell Programming and Scripting
Is there any way I can achieve this?
Considering test1 :
a 1 2 3 4
b 2 3 4 5
c 12 1232 14 1
d 10 13 4 5
e 1 5 6 9 1
And test to be some string :
qw
twe
tew
we
qw
I want something like this :
a 1 2 qw 4
b 2 3 twe 5 (5 Replies)
Discussion started by: aksijain
5 Replies
4. Shell Programming and Scripting
Hi Friends,
I am new to Shell Scripting and need your help in the below situation.
- I have two files (File 1 and File 2) and the contents of the files are mentioned below.
- "Application handle" is the common field in both the files.
(NOTE :- PLEASE REFER TO THE ATTACHMENT "Compare files... (2 Replies)
Discussion started by: Santoshbn
2 Replies
5. Shell Programming and Scripting
Hi,
I've internally searched through forums for about 2+ hours. Unfortunately, with no luck. Although I've found some cases close to mine below, but didn't help so much.
Actually, I'm in short with time. So I had to post my case. Hoping that you can help.
I have 2 files,
FILE1
... (1 Reply)
Discussion started by: amurib
1 Replies
6. Shell Programming and Scripting
Hi;
i have a file and i want to get;
- If the last word in line 14 is NOT equal to "Set."; then print 2nd, 3rd, 4th and 5th values of 3rd line.
and my code is:
nawk 'NR==14 {if ($NF!="Set.") (NR==3{print $2,$3,$4,$5}) }' file.txt
but no result?? :confused::(:confused::( (4 Replies)
Discussion started by: gc_sw
4 Replies
7. Shell Programming and Scripting
I need help counting the fields and field separators using Nawk.
I have a file that has multiple lines on it and I need to read the file 1 at a time and then count the fields and field separators and then store those numbers in variables. I then need to delete the first 5 fields and the blank... (3 Replies)
Discussion started by: scrappycc
3 Replies
8. Shell Programming and Scripting
Hi,
I need some help in knowing how I can append tabs at the end of each line...
The data looks something like this:
field1, field2, field3, field4
1 2
3 4 5
I have values in field1 and field 2 in the first row and I would like to append tab on field3 and field4 for the first row..and in... (6 Replies)
Discussion started by: madhunk
6 Replies
9. Shell Programming and Scripting
Hi All,
I have two comma separated value(CSV) files, say FileA and FileB.
The contents looks like that shown below.
FileA
EmpNo,Name,Age,Sex,
1000,ABC,23,M,
1001,DES,24,F, ... (2 Replies)
Discussion started by: ultimate
2 Replies