Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-23-2010, 05:44 AM   #1
LQ Newbie
Registered: Jan 2010
Posts: 9

Rep: Reputation: 0
merge file1 at end of line file2


Can anyony give me a hint on how I can merge the data from file1(data per line) to the end of line of file2. So what I mean is, I want to add every line from file1 to the end of the corresponding line of file2.

I'll be gratefull for any help you can give me!

Old 03-23-2010, 05:50 AM   #2
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1289Reputation: 1289Reputation: 1289Reputation: 1289Reputation: 1289Reputation: 1289Reputation: 1289Reputation: 1289Reputation: 1289
Not sure I understand what you are asking.

Here is an answer to one interpretation
cat file1 >> file2
Here is an answer to another interpretation
mv file2 file2.tmp
paste file2.tmp file1 > file2

Last edited by evo2; 03-23-2010 at 05:52 AM.
Old 03-23-2010, 06:27 AM   #3
LQ Newbie
Registered: Jan 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks Evo!!!

The second interpretation was exactly what I was looking for! Paste is the cmd I needed.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
dd if=file1 of=file2 bs=1k PUSHES AVG QUEUE LENGTH UP TO 80 !!!!! Jung Linux - General 8 04-09-2009 05:36 AM
extract matching lines from File2 based on File1. grep+while? pwd_pwd_omg_pwd Linux - Newbie 5 04-07-2009 02:48 PM
Copy from file1 to file2 - Trying sed LinuxCrayon Linux - Newbie 3 03-30-2008 08:51 AM
[Comp] How to create a file from the differences between file1 and file2 Xeratul Linux - Software 2 11-19-2006 02:20 PM
Avoid cat file1>>file2 automatic add return after file2. AshesOfTime Programming 5 11-25-2004 08:27 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration