hi,
I have in a directory a couple of files in different languages with names like:
bb_aaaaaa-aaaa-en.html
bb_aaaaaa-aaaa-es.html
bb_aaaaaa-aaaa-de.html
vv_aaaaaa-aaaa-en.html
vv_aaaaaa-aaaa-es.html
vv_aaaaaa-aaaa-de.html
ff_aaaaaa-aaaa-en.html
ff_aaaaaa-aaaa-es.html
ff_aaaaaa-aaaa-de.html
I want to create a 2 columns list with for a language pair. For example for the en de language pair.
bb_aaaaaa-aaaa-en.html bb_aaaaaa-aaaa-de.html
vv_aaaaaa-aaaa-en.html vv_aaaaaa-aaaa-de.html
ff_aaaaaa-aaaa-en.html ff_aaaaaa-aaaa-de.html
I have a bash script but it doesn't work.
Code:
#!/bin/sh
L1=en
L2=de
cat list.txt | awk '/*__.*__'$L1'.*__'$L2'/{
for (i=1; i <= NF; i++)
if (index($i, "__'$L1'.") > 0) { printf("%s", $i); break; }
for ( ; i <= NF; i++)
if (index($i, "__'$L2'.") > 0) printf(" %s", $i);
printf("\n"); }'
Could you help me please? Thank you in advance!