Shel Script [Tail] Return line at the end of each concatenated fichier

Asked

Viewed 39 times

0

Long live,

I have several files with the same headers. what I wanted is to copy the contents of all files inside 1 only but only with 1 header.

I’ve managed to do this part with the code below

head -3 $FILE1 > all.csv
tail -n +4 -q *.csv >> all.csv

Probleme wanted to change lines after each file. With the above command he does everything I want only that does not change line when changes file.

Someone has an idea ?

  • Could you put a very short example? With two of the .csv and the value of the file described in $FILE1?

  • That one tail *.csv >> all.csv can generate some read and write trouble in the same file (*.csv house with all.csv, then all.csv appears as an argument from the tail)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.