Search Results

Search: Posts Made By: winter9
2,173
Posted By bartus11
Try: perl -ne '$w+=s/[^...
Try: perl -ne '$w+=s/[^ ]+/$&/g;$c+=s/./$&/g;$l++;END{print "Lines: $l\nWords: $w\nCharacters: $c\n"}' file
8,312
Posted By sk1418
is this what you want? kent$ cat t1.txt ...
is this what you want?

kent$ cat t1.txt
>cat module1
200611051053 95
200523457498 35
200617890187 57
200726098123 ...
8,312
Posted By 116@434
or even this way: awk ' { arr[$1] = arr[$1] $2...
or even this way:
awk ' { arr[$1] = arr[$1] $2 } END {for (i in arr) print i arr[i] }' module1 module2
8,312
Posted By sk1418
for the first file, create an array. index is the...
for the first file, create an array. index is the column1. value is the whole line. after file1 was completely processed. start working on file2, read column1 from file2 as key, if the key is already...
8,312
Posted By 116@434
I was referring something similar to this: cat...
I was referring something similar to this:
cat file1 file2 | awk ' { arr[$1] = arr[$1] $2 } END {for (i in arr) print i arr[i] }'
8,312
Posted By sk1418
awk 'FNR==NR{a[$1]=$0;} NR>FNR{print a[$1]?...
awk 'FNR==NR{a[$1]=$0;} NR>FNR{print a[$1]? a[$1]" "$2 : $0}' t1.txt t2.txt
200645676712 71 56
200617890187 57 50
200523457498 35 29
200726098123 66 62
200744556590 68 69
200611051053 95 90
8,312
Posted By 116@434
Use this to collect the required info in a hash ...
Use this to collect the required info in a hash
{ reg[$1] = reg[$1] $2 }
then in the END print all the stuff using a loop.
Showing results 1 to 7 of 7

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