10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The awk below executes and produces the current output. it skips the header in row 1 and prints $4,$5,$6 and then adds the header row back.
The problem is that it keeps the tailing tab and prints it in front of $1. I could add a pipe to remove the tab, but is there a better way to do it with on... (7 Replies)
Discussion started by: cmccabe
7 Replies
2. Shell Programming and Scripting
In the awk below which does execute I get output that is close, except for all the lines that start with a # are removed. Some lines have one others two or three and after the script adds the
ID= to the fields below the pattern in the awk, I can not seem to add the # lines back to the output. ... (5 Replies)
Discussion started by: cmccabe
5 Replies
3. Shell Programming and Scripting
In the below awk the output is space delimited, but it should be tab delimited. Did I not add the correct -F and OFS? Thank you :).
The input file are rather large so I did not include them, but they are tab-delimeted files as well.
awk
awk -F'\t' -v OFS='\t' 'FNR==1 { next }
> ... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
I am just trying to output the below awk separated by tabs. Thank you :).
awk (added OFS as an attempt to itroduce tabs)
awk '{split($5,a,"-"); OFS='\t' print $1,$2,$3,a}' file.bed > test.bed
The awk runs and produces all the data in 1 field instead of 4 fields.
current output
... (2 Replies)
Discussion started by: cmccabe
2 Replies
5. Shell Programming and Scripting
In the gawk below, I am trying to output the file tab-deliminated but don't think that is the correct syntax. Thank you :).
gawk OFS='/t' '{sub(/-+/,"",$2); ar=$0}
END{n = asort(ar)
for (i = 1; i <= n; i++)
print ar}' file (2 Replies)
Discussion started by: cmccabe
2 Replies
6. Shell Programming and Scripting
awk 'BEGIN{
if('"$CATE"'<'"${WARN}"')
printf ("%s", "'"`Kfunc "" ; break`"'")
else if (('"${CATE}"'>='"${WARN}"') && ('"${CATE}"'<'"${CRIT}"'))
printf ("%s", "'"`Wfunc ""; break`"'")
else if ('"${CATE}"'>='"${CRIT}"')
printf... (6 Replies)
Discussion started by: SkySmart
6 Replies
7. Shell Programming and Scripting
Hello Friends,
I need to find some CDRs in production servers whose 1st field value and 2nd field value = 1 and 11th looks like 45.123... where there are more than 3 digits after comma.so i wrote a one liner, something like below but does not work, however when i used first and second conditions... (8 Replies)
Discussion started by: EAGL€
8 Replies
8. Shell Programming and Scripting
I'm having a problem pulling UID's from data. The data outputs a user's UID in one of three ways:
1. Error User user_name already assigned with <UID>
2. Success <UID> reserved for user_name
3. <a load of crap because there was a db failure yet somehow the UID is still in there>
I typically... (5 Replies)
Discussion started by: MaindotC
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have this output:
extended device statistics
device r/s w/s kr/s kw/s wait actv svc_t %w %b
sd1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd2 0.1 2.9 2.6 24.8 0.0 0.1 21.0 0 1
sd3 0.1 2.9 2.7 24.8 0.0 ... (9 Replies)
Discussion started by: mjnman
9 Replies
10. Shell Programming and Scripting
Dear All,
Good Day. I would like to hear your suggestions for the following problem:
I have a file with 5 columns with some numbers in 16 lines as shown below.
Input file:
Col 1 Col 2 Col 3 Col 4 Col 5
12 220 2 121 20
234 30 22 9... (3 Replies)
Discussion started by: Fredrick
3 Replies