Search Results

Search: Posts Made By: swapsb
5,631
Posted By Scrutinizer
var=047377710;sed -n "/^03,$var/,/^49,/p" infile...
var=047377710;sed -n "/^03,$var/,/^49,/p" infile > newfile
5,631
Posted By ctsgnb
For example, i have put the following code in a...
For example, i have put the following code in a script call "ak"
f=tst.abc
p=$1
t=${p%????}
ext=${p#$t}
awk -F"," -v P="$p" -v c="${f%.*}.${ext}" -v n="${f%.*}.new"...
5,631
Posted By
Try xargs -d"\|" file | tr '|03,' '\n' | grep...
Try
xargs -d"\|" file | tr '|03,' '\n' | grep "^03,047316555"| tr '\|' '\n'
5,631
Posted By ctsgnb
f=1234.abc p=12345555 t=${p%????} ...
f=1234.abc
p=12345555
t=${p%????}
ext=${p#$t}
nawk -F"," -v P="$p" -v c="${f%.*}.${ext}" -v n="${f%.*}.new" '(NF==2){f=($2==P)?c:n}{print $0 > f}' "$f"# cat 1234.5555
03,12345555
16,936,x,x,120...
5,631
Posted By
If your input file is having non variant data, I...
If your input file is having non variant data, I mean starting account data with id 30 and than 2 lines of data with id 16 and finishes with id 49 then I have a very simple solution for it.

xargs...
2,136
Posted By binlib
awk ' NR == FNR && $5 != 0 { if ($4 > m1) {...
awk '
NR == FNR && $5 != 0 {
if ($4 > m1) {
m2 = m1
c2 = c1
m1 = $4
c1 = $1
} else if ($4 > m2) {
m2 = $4
c2 = $1
}
}
NR > FNR && ($1 == c1 || $1 == c2)
'...
Showing results 1 to 6 of 6

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