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) >fileor use head to have a separator
head -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 terminal
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 sed
with awk
with cat only, I don't see how to do it :(
well yes, if you have control of the terminal
cat 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 sed
sed -s '$a*****' fic1 fic2 fic3
with awk
awk '{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!