Search Results

Search: Posts Made By: user8
2,649
Posted By user8
The usual approach is to put them either BEFORE...
The usual approach is to put them either BEFORE the BEGIN rule, or AFTER the END rule. Performance-wise, it doesn't matter. You might want to have a look at User-defined - The GNU Awk User's Guide...
1,564
Posted By user8
awk '/FILEHEADER/{p=1}p' $filename >...
awk '/FILEHEADER/{p=1}p' $filename > TESTA_Src_21.txt
3,282
Posted By user8
Another option which also seems to work: awk...
Another option which also seems to work:
awk '{str = str FS $4}!(NR%5){print "peak" ++c str; str=""}END{if (str) print "peak" ++c str}'
1,143
Posted By user8
awk -v var1="$var1" -v var2="$var2"...
awk -v var1="$var1" -v var2="$var2" 'NR>=1&&NR<=10 && $0 ~ var1 && $0 !~ var2 {...}'
PS: I am not sure what the test "NR>=1" is expected to do.
873
Posted By user8
awk '{ for (i = $2; i < $3; i += 100) { print $1,...
awk '{ for (i = $2; i < $3; i += 100) { print $1, (a[NR]++ ? i + 1 : i), i + 100 }'
1,275
Posted By user8
Assuming that you are interested in the last...
Assuming that you are interested in the last field of rows containing "Thermal thickness"
awk '/Thermal thickness/ { Tt = $NF }'
1,155
Posted By user8
You could start with: awk '{a[$3 " - "...
You could start with:
awk '{a[$3 " - " $6]++}END{ for (i in a) print i, "=", a[i]}'
1,950
Posted By user8
And 2 "y"
And 2 "y"
1,704
Posted By user8
I don't see any easier way than what you...
I don't see any easier way than what you suggested. Below some (untested) code:


awk 'NR==FNR{p[$1]=$2;next}{ v=substr($1,1,5); print v in p ? p[v] : "Some warning"}' table1 table2
1,288
Posted By user8
See the man page of the wc utility: "wc - print...
See the man page of the wc utility: "wc - print newline, word, and byte counts for each file"
1,288
Posted By user8
Hmm. I don't really understand what the issue is....
Hmm. I don't really understand what the issue is. Please wrap data and code in CODE tags.
1,288
Posted By user8
For detecting differences in the first field (if...
For detecting differences in the first field (if this is what you mean with "column"), you could try:
paste File_1 File_2 | awk '$1 != $5'
1,275
Posted By user8
You can try: awk 'BEGIN{ print "sL0", "dL0",...
You can try:
awk 'BEGIN{ print "sL0", "dL0", "Tb","Tu"}/sL0.*dL0/{sL0=$3;dL0=$6}/Tb.*Tu/{ print sL0, dL0, $3,$6}'
3,151
Posted By user8
Are you sure about the field delimiter? When...
Are you sure about the field delimiter? When using your above code, GNU cut tells me cut: the delimiter must be a single character

The other cut which I have here says: cut: bad delimiter
1,803
Posted By user8
I don't think this would make a difference, as...
I don't think this would make a difference, as the OP reported that the given FS is already good enough to detect the duplicates.
1,803
Posted By user8
Broken awk? See the hints posted by Don Cragun.
Broken awk? See the hints posted by Don Cragun.
5,949
Posted By user8
See my earlier reply.
See my earlier reply.
5,949
Posted By user8
This works for me in bash: echo...
This works for me in bash: echo "'"${msg//\'/}"'"
1,803
Posted By user8
This works for me (using gawk): gawk -F',| '...
This works for me (using gawk):
gawk -F',| ' '!(a[$1,$2]++ + a[$2,$1]++)'
1,554
Posted By user8
[QUOTE=Jotne;302769106]awk -F. '{$NF=""}1 OFS=. |...
[QUOTE=Jotne;302769106]awk -F. '{$NF=""}1 OFS=. | fileShort code, but have a bug, it ends the line with a .
Try: awk -F. 'NF--' OFS=.
869
Posted By user8
I just tried this with GNU sort and awk and it...
I just tried this with GNU sort and awk and it seems to work fine:
sort -r -k5 t3 | awk '!a[$1,$3]++'PS: This record has no space between "Italy" and the pipe character.
Italy| John | 08:22:12:349
96,302
Posted By user8
You are right. I should have mentioned this.
You are right. I should have mentioned this.
96,302
Posted By user8
About how to print: "last row with fifth column;...
About how to print: "last row with fifth column; in each file":
END{ print $5 }or in case you are using gawk 4.x:
ENDFILE{ print $5 }
4,596
Posted By user8
Try: kill %%
Try: kill %%
4,596
Posted By user8
( while true ; do date; netstat -antp | grep 1424...
( while true ; do date; netstat -antp | grep 1424 | grep -v "runmqlsr"| wc - l ; sleep 1 ; done >> test.out ) &


PS: Please put CODE tags around your code. This facilitates copy & paste.
...
Showing results 1 to 25 of 33

 
All times are GMT -4. The time now is 03:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy