Search Results

Search: Posts Made By: sraj142
1,733
Posted By ygemici
# awk 'BEGIN{printf...
# awk 'BEGIN{printf "%-10s%20s%10s\n","Host_name","ip_address","RQ_Name"}{if(/^s/){s=$0;while(getline){if(/^@/)break;if(/rq/)s=s $0};
gsub(": *|rq...
1,733
Posted By bartus11
Try:awk...
Try:awk 'NR==FNR{a[$2]=$1;next}/host/{h=$3}/rq/{r=$3}/^@/{print h,a[h],r}' /etc/hosts /etc/qconfig
4,080
Posted By Peasant
Try if this works for you : netstat -an |...
Try if this works for you :

netstat -an | grep 192.168.156.1.16507 | awk '{print $5}' | awk '{FS="."} {print "lsof -iTCP:"$5}' | sh


Or use for loop (or while read line ) :

for i in...
976
Posted By jayan_jay
$ a="Process / Transaction ID .. .. .. .. .. .....
$ a="Process / Transaction ID .. .. .. .. .. .. .. 15991150.13 (query)"
$ echo "$a" | nawk -F. '{print $(NF-1)}'
15991150
$
1,536
Posted By Franklin52
Or maybe with: awk -F"|"...
Or maybe with:
awk -F"|" '{a[$(NF-1)]++}END{for(i in a) print i FS a[i]}' file
1,536
Posted By jayan_jay
For the posted input file .. $ nawk -F\|...
For the posted input file ..

$ nawk -F\| '{print $(NF-1)|"sort|uniq -c"}' infile
2 ROH_CEN3
7 ROH_CEN4
3 ROH_CEN5
7 S03_AU480
3,206
Posted By cero
vi does not keep the file open - you actually...
vi does not keep the file open - you actually work on a hidden file. Use something like less to simulate an open file.
2,802
Posted By itkamaraj
its possible with the above same code.. need some...
its possible with the above same code.. need some changes... try it out and let us know
2,802
Posted By itkamaraj
$ nawk -F"\|" ' { arr[$1]++ } END { for( no in...
$ nawk -F"\|" ' { arr[$1]++ } END { for( no in arr) { print no , arr[no] } } ' test
199 9
VK1 8
871 8
61B 1
650 3
897 1
333 4
1 3

taken from the old post.. ...
3,501
Posted By pravin27
Hi Sraj, -F"|" = Input field separator NR =...
Hi Sraj,
-F"|" = Input field separator
NR = This is the number of input records awk has processed since the beginning of the program's execution.
FNR= FNR is the current record number in the...
3,501
Posted By pravin27
Could this help you ? awk -F"|"...
Could this help you ?
awk -F"|" 'NR==FNR{a[$1]=$0;next}a[$5]{print a[$5]FS$0}' file1.txt file2.txt
Showing results 1 to 11 of 11

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