Cat Command
Solved
akhx
Posted messages
1
Status
Member
-
shadoxys Posted messages 3 Status Member -
shadoxys Posted messages 3 Status Member -
Hello, I need to merge 3 text files into 1 and then separate them with ****** (aster). I can't figure out which command I could use in conjunction with Cat. I'm using Fedora 14.
Thank you in advance.
Thank you in advance.
5 answers
-
hello
(cat file1 ; echo "*****" ; cat file2 ; echo "******" ; cat file3) >file
or use head to have a separatorhead -999999 file1 file2 file3 >file
-
hi,
with cat only, I don't see how to do it :(
well yes, if you have control of the terminalcat fic1 - fic2 - fic3
you type *****, then Enter, then Ctrl-D, each time the command returns the terminal.
but it's not very convenient ;)
can you use other tools?
with sedsed -s '$a*****' fic1 fic2 fic3
with awkawk '{if(NR>FNR){NR=1; printf("%s\n%s\n","*****",$0)}else{print}}' fic1 fic2 fic3 -
Thank you so much for your answers. It's exactly what I was looking for. This is my first time posting on this site and wow, what a result! Thank you for taking the time to respond to me. See you later, guys!
-
hello,
cat file1 file2 file3 >file
a+ -
Pour this part it’s fine, actually what I would like to do is once the 3 texts are gathered, I would like to separate the texts in the new file with ***. Simply to be able to distinguish them.
cat fichier1 fichier2 fichier3 > fichier | ??????
Thank you