10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I am using awk to print 10,11 column but it is not displaying required output.
Please let me know how I can browse through the line and extract the required one
Example: I have below 2 lines in file
seq 49960| Thu Apr 19 10:57:40.726182 2018|Len: 89|GAP for CL/U18 9P-NC (CL90U8)) gap... (10 Replies)
Discussion started by: sdosanjh
10 Replies
2. Shell Programming and Scripting
In the awk I am trying to add :p.=? to the end of each $9 that matches the pattern NM_. The below executes andis close but I can not seem to figure out why the :p.=? repeats in the split as in the green in the current output. I have added comments as well. Thank you :).
file
... (4 Replies)
Discussion started by: cmccabe
4 Replies
3. Shell Programming and Scripting
Hi All,
i have an output of command vmstat as below :
$ vmstat
System configuration: lcpu=4 mem=5376MB ent=1.00
kthr memory page faults cpu
----- ----------- ------------------------ ------------ -----------------------
r b avm fre re pi... (10 Replies)
Discussion started by: omkar.jadhav
10 Replies
4. UNIX for Dummies Questions & Answers
Hi !
I have a tab-delimited file, file.tab:
Column1 Column2 Column3
aaaaaaaaaa bbtomatoesbbbbbb cccccccccc
ddddddddd eeeeappleseeeeeeeee ffffffffffffff
ggggggggg hhhhhhtomatoeshhh iiiiiiiiiiiiiiii
... (18 Replies)
Discussion started by: lucasvs
18 Replies
5. Shell Programming and Scripting
awk 'BEGIN{IGNORECASE=1} /error|warning|exception/ { ++x } END { print x }' filename
The above command returning the number of times the pattern present in the file. But I want the the line number as well. please help me out (6 Replies)
Discussion started by: arukuku
6 Replies
6. Shell Programming and Scripting
Hi ,
I have the file where i have to search for the pattern. The pattern may be lower case or upper case or camel case. Basically I want to ignore while searching the pattern in awk.
awk '/error|warning/exception/' filename
Please help me (3 Replies)
Discussion started by: arukuku
3 Replies
7. Shell Programming and Scripting
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies
8. Shell Programming and Scripting
using awk convert 3 rd fileld of file as 5 digit and then display changed file.
like
1 2
23445 3452 3343
3 5 6 6
================
o/p:-
1 2
23445 3452 03343
3 5 00006 6 (1 Reply)
Discussion started by: RahulJoshi
1 Replies
9. Shell Programming and Scripting
hi,
let's say $numbers = "324 350 587" an so on...
what i'm trying to do is this:
awk -v numbers="$numbers" '{if (numbers ~ /$2/) print $0, "bla bla"}' file
# file looks like this:
214 .....
215 ...
216 ....
250
...
324
325
...
350 something ...
...
587 ... (4 Replies)
Discussion started by: someone123
4 Replies
10. Shell Programming and Scripting
I got a sample file like this.
$ cat test
12|13|100|s
12|13|100|s
100|13|100|s
12|13|100|s
I want to replace all 100 by 2000 only in 3rd field using "awk"
This is replacing all 100's :-(
$ awk -F "|" '{gsub( /100/,"2000");print}' test
12|13|2000|s
12|13|2000|s
2000|13|2000|s... (5 Replies)
Discussion started by: jkl_jkl
5 Replies