Search Results

Search: Posts Made By: Sanjeev Yadav
2,425
Posted By Corona688
Same file with delimiters: while IFS=","...
Same file with delimiters:

while IFS="," read VAR1 VAR2 THEREST
do
...
done < inputfile

Two files:

exec 5<file1 # Open file into FD 5
exec 6<file2

while read VAR1 <&5 && read...
889
Posted By bartus11
sort file | uniq -c
sort file | uniq -c
1,784
Posted By ygemici
maybe try this # awk...
maybe try this
# awk '{x=",";a[$1]=a[$1]&&p!=$2?a[$1]x$2:$2;p=$2}END{for(i in a){if(length(a[i])!=1)print i,a[i]}}' file
XYZ 1,3
qwe 2,1,3
1,784
Posted By itkamaraj
$ sort -u test.txt | awk '{a[$1]++;next}END{for(i...
$ sort -u test.txt | awk '{a[$1]++;next}END{for(i in a){if(a[i]>=2){print i}}}'
XYZ
qwe
6,960
Posted By balajesuri
If you're using modern bash or ksh, try this: ...
If you're using modern bash or ksh, try this:

To strip first 10 chars:
$ x='e3kbaird 20120402104958362 1'
$ echo "${x:0:10}"
e3kbaird 2
$

To strip the last 2 characters:
$ echo "${x: -2}"...
6,960
Posted By itkamaraj
awk '{print $1,$NF}' test.txt | sort -u
awk '{print $1,$NF}' test.txt | sort -u
Showing results 1 to 6 of 6

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