Awk: извлекать разные столбцы из разных файлов
File Example
I have a 3-10 amount of files with:
- different number of columns
- same number of rows
- inconsistent spacing (sometimes one space, other tabs, sometimes many spaces) **within** the very files like the below
> 0 55.4 9.556E+09 33
> 1 1.3 5.345E+03 1
> ........
> 33 134.4 5.345E+04 932
>
........
Мне нужно получить столбец (скажем) 1 из файла1, столбец 3 из файла2, столбец 7 из файла3 и столбец 1 из файла4 и объединить их в один файл рядом друг с другом.
Trial 1: не работает
paste <(cut -d[see below] -f1 file1) <(cut -d[see below] -f3 file2) [...]
where the delimiter was ' ' or empty.
Trial 2: работа с двумя файлами, но не со многими
awk '{
a1=$1;b1=$4;
getline <"D2/file1.txt";
print a1,$1,b1,$4
}' D1/file1.txt >D3/file1.txt
Теперь более общий вопрос:
How can I extract different columns from many different files?