LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-26-2014, 06:52 AM   #1
msarguru
LQ Newbie
 
Registered: Sep 2014
Posts: 3

Rep: Reputation: Disabled
Question Merge multiple files with common header


Hi all,
Say i have multiple files x1 x2 x3 x4, all with common header (date, time, year, age),,
How can I merge them to one singe file "X" in shell scripting

Thanks for your suggestions.
 
Old 09-26-2014, 07:17 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,502

Rep: Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432Reputation: 2432
can you please give us a more detailed description and/or some examples?
 
Old 09-26-2014, 08:34 AM   #3
msarguru
LQ Newbie
 
Registered: Sep 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
File: x1

date time year age
101014 1344 2012 52
111012 1200 2010 49

File:x2

date time year age
140112 1100 2011 54
230113 0500 2005 46

similiary for other files x3 and x4


have to put them altogether like

date time year age
101014 1344 2012 52
111012 1200 2010 49
140112 1100 2011 54
230113 0500 2005 46
and the similar data from x3 and x4
 
Old 09-26-2014, 08:43 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
what have you tried and where are you stuck ?

i think you should strip the 1st record off of each file (sed ?) and then merge those files with cat and redirect them (>) to another output.
 
  


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
merge columns from multiple files vijay_babu1981 Linux - Newbie 21 06-24-2014 07:59 AM
How do I merge multiple flac files into single image? Tom Nyskelo Linux - Software 4 08-07-2008 09:07 PM
merge multiple pdf files esteeven Linux - Software 8 11-21-2007 02:59 PM
How To Merge multiple files into a single PDF ? kkempter Linux - Software 1 10-28-2005 02:02 PM


All times are GMT -5. The time now is 03:37 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