Search Results

Search: Posts Made By: OTNA
1,552
Posted By RudiC
man awk might help. However. tryawk ...
man awk might help. However. tryawk '/3100.2.22.4/ && !/3100.2.22.11/ {print > "myfile1"; next}
{print > "myfile2"}
' file
7,767
Posted By RudiC
Try awk -F! 'match ($0, "3100.2.22.1[^!]*")...
Try awk -F! 'match ($0, "3100.2.22.1[^!]*") {print >FILENAME " " substr ($0, RSTART, RLENGTH); next}
{print >FILENAME " without_tag"}
' hd_auto_*
6,130
Posted By DeCoTwc
Someone already posted a very elegant awk...
Someone already posted a very elegant awk solution, so this is just because I like trying to solve things in pure shell.

i=1;while read -a line;do line[4]=$i;echo "${line[@]}";let i=i+1;done <...
6,130
Posted By Chubler_XL
How about this: awk 'NF > 4 {$5 = ++N} 1'...
How about this:

awk 'NF > 4 {$5 = ++N} 1' infile
6,959
Posted By MadeInGermany
"Connection reset by peer" is a message from TCP...
"Connection reset by peer" is a message from TCP in the TCP/IP stack.
It indicates a network problem, for example a misconfigured fire wall.
I don't see why you get this - perhaps because you did...
4,901
Posted By Subbeh
I don't completely understand your goal, but if...
I don't completely understand your goal, but if you want to parse the count variable to awk you can do this:

awk '/TICKET NBR/ && ++i==c' c=$count file
1,305
Posted By RudiC
OK, try this:awk -F= '!/^3100.2.128.8/ ...
OK, try this:awk -F= '!/^3100.2.128.8/ {print; next}
Arr[$1] !~ $2 {Arr[$1]=Arr[$1] (Arr[$1]?" | ":"") $2}
END {for (A in Arr) print A "=" ...
1,305
Posted By radoulov
Another one: awk '$1 == s { t[$2]++ || r...
Another one:

awk '$1 == s {
t[$2]++ || r = r ? r q $2 : $0
next
}
r {
print r; r = x
split(x, t) # use delete x if available
}
1' FS== q=\| s=3100.2.128.8 infile
1,233
Posted By pamu
Please use code tags for code and data sample. ...
Please use code tags for code and data sample.

try

awk -F "=" '{if(!A[$1]){print }else{print $1".ADD"A[$1] FS $2}}{A[$1]++}' file
988
Posted By pravin27
Hi OTNA, awk -F"=" '{gsub(" ","",$2); if...
Hi OTNA,
awk -F"=" '{gsub(" ","",$2);
if ($1=="bundle_identifier") {
if ($2=="A"){print $0;next} else {next}}
if(!a[$1]++){print}}' OFS="=" filename
Showing results 1 to 10 of 10

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