Search Results

Search: Posts Made By: sheetalk
2,001
Posted By RudiC
What are the special chars? And why is...
What are the special chars? And why is rwerq5555525525 in your desired output?
1,026
Posted By RudiC
Would this help? awk ' BEGIN {FS =...
Would this help? awk '
BEGIN {FS = OFS = SUBSEP = "\t"
}
FNR == NR {K[$1]
V[$1,$2] = $3
next
}
...
881
Posted By RudiC
Tryawk ' !NF {if (SUM > 250) {++BLK ...
Tryawk '
!NF {if (SUM > 250) {++BLK
for (c=1; c<=CNT; c++) print "Block" BLK, M[c]
}
SUM = CNT = 0
next
}
$2 >=30...
881
Posted By Yoda
Try this:- awk ' BEGIN { ...
Try this:-
awk '
BEGIN {
X = 1
F = 1
}
$2 >= 30 {
F = 1
++C
A[X,C] = $0
...
10,339
Posted By Scrutinizer
Note that this is technically not a join...
Note that this is technically not a join operation since you are also merging on fields that the files do not have in common, so the join command would not work anyway.

Also, these are TAB...
10,339
Posted By Aia
See if this is of any use. #!/usr/bin/perl # ...
See if this is of any use.
#!/usr/bin/perl
#
use strict;
use warnings;

# two files must be given at command line
my $first_file = shift or die;
my $second_file = shift or die;

my %data;...
10,339
Posted By RavinderSingh13
Hello sheetalk, I haven't tested in...
Hello sheetalk,

I haven't tested in different scenarios but could you please check following if that helps you.

awk -F"\t" 'FNR==NR{A[$1]=$0;next} ($1 in...
1,120
Posted By RudiC
You lost me, entirely. I can't understand your...
You lost me, entirely. I can't understand your request nor your code sample. However, threefour comments on your code:
- FILENAME=="data.txt" && NR==1 won't ever become TRUE as NR is the stream...
1,038
Posted By Scrutinizer
This should fix that: awk ' $2 in A { ...
This should fix that:
awk '
$2 in A {
o=A[$3];
for(i in A) if (A[i]==o) A[i]=A[$2]
next
}
$3 in A {
A[$2]=A[$3]
next
}
{
A[$2]=A[$3]=$1
}
END {
...
1,038
Posted By Scrutinizer
Interesting problem... First attempt: awk ' ...
Interesting problem... First attempt:
awk '
$2 in A {
A[$3]=A[$2]
next
}
$3 in A {
A[$2]=A[$3]
next
}
{
A[$2]=A[$3]=$1
}
END {
for(i in A)...
Showing results 1 to 10 of 10

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