Search Results

Search: Posts Made By: shizik
2,622
Posted By itkamaraj
replace > output.txt to >>...
replace

> output.txt

to

>> output.txt
1,040
Posted By Ygor
Try...awk '{a[$1]+=$2;b[$1]+=$3}END{for(c in...
Try...awk '{a[$1]+=$2;b[$1]+=$3}END{for(c in a)print c,a[c],b[c]}' file1
1,070
Posted By Ygor
Duplicate thread. ...
Duplicate thread.
https://www.unix.com/shell-programming-scripting/154633-awk-programming.html
2,652
Posted By Aia
I don't know what gave you the impression that...
I don't know what gave you the impression that sed would do a faster job than grep or awk for the same matter.

The syntax for what you want is:
sed -n '/matching_pattern/ p' filename

Which it...
Forum: Programming 06-13-2010
1,547
Posted By Tytalus
one way: # sed -e 's/,/ /g' -e...
one way:


# sed -e 's/,/ /g' -e 's/\"\([0-9]*\) \([0-9]*\)\"/\1\,\2/g' infile
0 1 0 87 0 0 6,87 170,03 0 43,5 0 0 0 0 6,87 126,53


HTH
Forum: Programming 06-13-2010
1,547
Posted By pseudocoder
Another way, which is pretty similar to Tytalus'...
Another way, which is pretty similar to Tytalus' approach:
$ echo '0,1,0,87,0,0,"6,87","170,03",0,"43,5",0,0,0,0,"6,87","126,53"' |\
> sed 's/"\([0-9]*\),\([0-9]*\)"/\1.\2/g;s/,/ /g;s/\./,/g'
0 1...
2,296
Posted By bartus11
The easiest way to solve that problem is to...
The easiest way to solve that problem is to install gawk ;) I think it is included in Solaris 10 Companion CD.

You could also use Perl:
perl -pe 's/,/ /g;s/\"([0-9]+) ([0-9]+)\"/\1,\2/g' infile
2,284
Posted By vgersh99
nawk 'FNR==NR {f1[$1];next} $1 in f1' file1 file2
nawk 'FNR==NR {f1[$1];next} $1 in f1' file1 file2
Showing results 1 to 8 of 8

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