Hello All,
I have several column files like this
$cat a_b_s1.xls
1wert
2tg
3asd
4asdf
5asdf
$cat c_d_s2.xls
1wert
2tg
3asd
4asdf
5asdf
desired put put
$cat combined.txt
s1 s2
1wert 1wert
2tg 2tg
3asd 3asd
4asdf 4asdf
5asdf 5asdf
My current approach
ls -1 *.xls | sort > all_xls
cat all_xls | awk -F"[_.]" '{print $3}' | tr "\n" "\t" > colhead.txt
cat all_xls | tr "\n" "\t" | xargs paste > all_combined.txt
cat colhead.txt all_combined.txt > new_file.txt
Is there a better way to do this. I have formating issues with I import the new_file.txt to excel. I think its because of replacing the new line character.
Thanks