i am having 2 files like this
file 1
1,
2,
3,
4,
file2
5,
6,
7,
8,
what i want do is like this
i want to put all the contents for file 2 after file 1,means adding column in file1
output should be like this.
1,5,
2,6,
3,7,
4,8,
i am having 2 files like this
file 1
1,
2,
3,
4,
file2
5,
6,
7,
8,
what i want do is like this
i want to put all the contents for file 2 after file 1,means adding column in file1
output should be like this.
1,5,
2,6,
3,7,
4,8,
paste -d "" file1 file2
can we do this every time means
contents of file1
1,5,
2,6,
3,7,
4,8,
content of file3
s1,
s2,
s3,
s4,
the combined the output will be
1,5,s1,
2,6,s2,
3,7,s3,
4,8,s4,
is it possible
plz elaborate meaning of inverted comma in this command
paste -d "" file1 file2
man paste
NAME
paste - merge lines of files
DESCRIPTION
Write lines consisting of the sequentially corresponding lines from
each FILE, separated by TABs, to standard output. With no FILE, or when FILE is -, read standard input.
-d, --delimiters=LIST
reuse characters from LIST instead of TABs
paste -d "" file1 file2 file3(if provided)
The above command should work fine!
awk 'NR==FNR{a[FNR]=$0}NR>FNR{b=a[FNR]FS$0;print b}' file1 file2