LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


Hello,

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!

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

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

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

Last edited by evo2; 03-23-2010 at 04:52 AM.
 
Old 03-23-2010, 05:27 AM   #3
porkcharsui
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.
 
  


Reply


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 04:36 AM
extract matching lines from File2 based on File1. grep+while? pwd_pwd_omg_pwd Linux - Newbie 5 04-07-2009 01:48 PM
Copy from file1 to file2 - Trying sed LinuxCrayon Linux - Newbie 3 03-30-2008 07:51 AM
[Comp] How to create a file from the differences between file1 and file2 Xeratul Linux - Software 2 11-19-2006 01:20 PM
Avoid cat file1>>file2 automatic add return after file2. AshesOfTime Programming 5 11-25-2004 07:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 PM.

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