hello people,

I saw this post

https://unix.stackexchange.com/questions/783990/merge-multiple-files-using-full-join-by-the-first-column/784240#784240

and just had fun writing the following solution but there is no way I'll
create an account on stackexchange. feel free to reuse if you think it's
helpful.

<<% cat > 346_T1_A_deduped.bismark.cov_format
1_10525 95.2
1_10526 98.9690721649485
1_10542 80.8
1_10543 87.6288659793814
%
<<% cat > 346_T1_B_deduped.bismark.cov_format
1_10525 95.7142857142857
1_10526 98.1132075471698
1_10542 78.5714285714286
1_10549 75.4716981132076
%
raku -e '
        say join ",",  @*ARGS;
        my %data = @*ARGS.map: { $_ => %(  .IO.lines.map: | *.words ) };
        for keys set %data.values».keys -> \k {
                say join ",", k, @*ARGS.map: { %data{$_}{k} // "N/A" }
        }
' *mat

346_T1_A_deduped.bismark.cov_format,346_T1_B_deduped.bismark.cov_format
1_10526,98.9690721649485,98.1132075471698
1_10543,87.6288659793814,N/A
1_10525,95.2,95.7142857142857
1_10542,80.8,78.5714285714286
1_10549,N/A,75.4716981132076

HTH, regards

-- 
Marc Chantreux
Pôle CESAR (Calcul et services avancés à la recherche)
Université de Strasbourg
14 rue René Descartes,
BP 80010, 67084 STRASBOURG CEDEX
03.68.85.60.79

Reply via email to