9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I used the following one liner (obtained from an old thread on this site) to look for RSS size of a process and convert it to Mb (I am using process nfsmapid as an example):
ps -eo rss,args | nawk 'END { print s/1024, "Mb" } /nfsmapid/ { s += $1 }'
I found that the RSS Mb displayed was always... (1 Reply)
Discussion started by: thaebich
1 Replies
2. UNIX for Dummies Questions & Answers
Input:
A|1
B|2
C|3
D|4
Output:
A+B|3
A+C|4
A+D|5
B+C|5
B+D|6
C+D|7
A+B+C|6
A+B+D|7
A+C+D|8
B+C+D|9
A+B+C+D|10
I only managed to get the output for pairs of $1 values (i.e. combination of length 2): (4 Replies)
Discussion started by: beca123456
4 Replies
3. Shell Programming and Scripting
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies
4. 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
5. Shell Programming and Scripting
Hello,
I have a text file with n lines in the following format (9 column fields):
Example:
contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c
I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Discussion started by: s052866
3 Replies
6. UNIX for Dummies Questions & Answers
Hi Guys,
I wanted to count the number of records for a particular field of a file. whose fields are separated by comma","
I fI use this command.
cat "filename" cut -sd "," -f13 | wc -l
This shows all the lines count including the blank values for the field number 13. I wanted to count... (2 Replies)
Discussion started by: Swapna173
2 Replies
7. Shell Programming and Scripting
I've written a script to count the total size of SAN storage LUNs, and also display the LUN sizes.
From server to server, the LUNs sizes differ.
What I want to do is count the occurances as they occur and change.
These are the LUN sizes:
49.95
49.95
49.95
49.95
49.95
49.95
49.95
49.95... (2 Replies)
Discussion started by: cyber111
2 Replies
8. 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
9. Shell Programming and Scripting
I have two files. File A and File B.
File A has two fields separated by comma
352020252365988, 652020100572356
546876543215667, 652065465654686
...
File B has many Fields separate by spaces
Date Name 352020252365988 Reference
Date2 Name2 546876543215667 Reference
I want to... (4 Replies)
Discussion started by: axl
4 Replies