I have created these files in a particular directory
a_1.txt
a_2.txt
...
..
a_n.txt
Each file has a single line.
I want to write a output file a.txt, which will have concantated value of string from all the files.
which utility should i use. copy, cat or paste????
Can anyone help me for this shell script for this.
thanks a ton in advance.
reagrds
vin
Hitori
2
$ cat a_*.txt | tr -d '\n' > a.txt
can i use
paste
As i found the final output will have all string in appended form.
But , I want to concantate the string which is in stone alone file into a single string.
Hitori
4
can you post an example of what you want to have in result?
i have file like :
file_1.txt
file_2.txt
file_3.txt
...
...
file_n.txt
and each file have one string (similar nature)
File_1.txt
111
file_2.txt
222
file_3.txt
333
....
file_n.txt
nnn
following the above example
I want a output file as file.txt and string inthe file should be
11122233334444....nnn
How to do this through script...ie first checking into folder ie how many files subfile exist and then merge a master file out of child file.
thanks a ton in advance
anand
Hitori
6
but why not
$ cat file_*.txt | tr -d '\n' > file.txt
this will give 11122233334444....nnn