-
merge lines of file by using pasteComputer/linux 2013. 3. 19. 19:53
Linux is always so powerful to do something, in my life. And it makes my life ease...
Sometimes, I need a special tool to merge two or multiple files into a file. So here is the
neat solution for that.
$ more {1,2}.dat
::::::::::::::
1.dat
::::::::::::::
1
2
3
::::::::::::::
2.dat
::::::::::::::
A
B
C
$ paste {1,2}.dat
1 A
2 B
3 C
$ paste -d" " {1,2}.dat
1 A
2 B
3 C
$ paste -d"," {1,2}.dat
1,A
2,B
3,C$ paste *.dat
1 A
2 B
3 CPASTE(1) User Commands PASTE(1)
NAME
paste - merge lines of files
SYNOPSIS
paste [OPTION]... [FILE]...
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.
Mandatory arguments to long options are mandatory for short options too.
-d, --delimiters=LIST
reuse characters from LIST instead of TABs
-s, --serial
paste one file at a time instead of in parallel
--help display this help and exit
--version
output version information and exit
AUTHOR
Written by David M. Ihnat and David MacKenzie.'Computer > linux' 카테고리의 다른 글
gnome-keyring can't connect to pkcs11 file (0) 2013.03.26 make an iso file from CD or DVD (0) 2013.02.21 NH 오픈 뱅킹 - 농협 인터넷 뱅킹 on Debian 7 Linux (0) 2013.01.20