Search Results

Search: Posts Made By: humaemo
30,929
Posted By Peasant
You can pass it with -v awk -v...
You can pass it with -v

awk -v outfln="brazil.dat" -v somevar="089" '{ DUNS = substr($0,0,9);if ( substr($0,14,3) == somevar ) print DUNS > outfln }' J1202523.TXT
2,549
Posted By harish612
Try below code .. rm -f present.txt...
Try below code ..
rm -f present.txt notpresent.txt
while read line
do
line1=`grep -ie "${line}" otherfile.txt `
if [ $? -eq 0 ] ; then
echo "$line" >> present.txt
else
echo...
8,965
Posted By Andre_Merzky
Hmm, interesting, seems to work ok for me: ...
Hmm, interesting, seems to work ok for me:



merzky@thinkie:~/test/unix.com$ cat multiline.txt
000000001 12335 Infinte solutiong PO box copyright
000000002 12335 Dhahran solutiong
PO box...
8,965
Posted By Andre_Merzky
cat multiline.txt | perl -e ' while ( <> ) { ...
cat multiline.txt | perl -e ' while ( <> ) {
chomp;
print "\n" if m/^\d{9}\s.*/ ;
print "$_ ";
}
print "\n";'
The removal of the first empty line is left as an excercise to the reader...
2,178
Posted By yazu
Well, there is not "Lookup Time" in this line....
Well, there is not "Lookup Time" in this line. Try:
perl -lpe 's!.*(<DTCLIENT>.*?</DTCLIENT>).*(<APPID>.*?</APPID>).*(Lookup Time=[^*]*)?.*!$1\t$2\t$3!'
2,178
Posted By Shell_Life
sed 's#.*\(<DTCLIENT>.*</DTCLIENT>\).*#\1#'...
sed 's#.*\(<DTCLIENT>.*</DTCLIENT>\).*#\1#' input_file > dt.txt
sed 's#.*\(<APPID>.*</APPID>\).*#\1#' input_file > app.txt
2,178
Posted By yazu
perl -lpe...
perl -lpe 's!.*(<DTCLIENT>.*?</DTCLIENT>).*(<APPID>.*?</APPID>).*!$1\n$2!' INPUTFILE
1,932
Posted By Franklin52
awk -F- '$3 == 139302 || $3 == 994{print >...
awk -F- '$3 == 139302 || $3 == 994{print > "conditiontrue";next}1' inputfile > conditionfalse
1,932
Posted By hergp
Is that what you need? $ awk -F- '$3 ==...
Is that what you need?


$ awk -F- '$3 == 139302 || $3 == 994' inputfile
SV-INCR-139302-365540488-201104090934.sqllog
SV-INCR-994-386000426-201104080808.sqllog
Showing results 1 to 9 of 9

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