Pls help me on this. I have to 2 files like shown below:
File 1
TAIJM
AXPKIM
BEMGW
File 2
PXMPA
JYGE
IMJP
What i want to do is to paste both file to a new file on thir format:
File 3
TAIJM PXMPA
AXPKIM JYGE
BEMGW IMJP
I tried cat and print, but it doesn't work. Cn anyone help me on this? Thanks
---------- Post updated at 09:46 AM ---------- Previous update was at 09:44 AM ----------
It should appear to be in column, with space between the two strings. Thanks!
It worked! Thanks a lot. Another questions, for further editing. I want the second column to be align; meaning, their first character is aligned with each other. And there should be a space between them
---------- Post updated 06-21-09 at 03:56 AM ---------- Previous update was 06-20-09 at 08:16 PM ----------
Anyone who can help me further with this one? Thanks in advance
.... | awk '{ printf "%-6s %-7s\n",$1,$2 }' (adjust values according to data)
Can u pls explain that code? And how the output will look like. Thanks!
paste file1 file2| awk '{ printf "%-6s %-7s\n",$1,$2 }'
paste will merge your files tab separated as durden_tyler said and awk will format the output in lines with 2 strings separated by a space, both left alligned, assuming that the first column contains strings not longer than 6 characters and the second one not longer than 7 characters. This is just an example, adjust the length to the "real" data.