- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: combine records in files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2004 07:12 AM
02-19-2004 07:12 AM
I have two data files. I need to merge the records, but cannot figure out how to do this. I have discovered numerous ways to append fileA to fileB, but the records need to be merged.
Example
FileA has records:
This is a
And so is
This one is
FileB has records:
long record
this record
longer now
I need a third file, FILEC which would look like this:
This is a long record
And so is this record
This one is longer now
Does anyone know of a way to do this? I am fairly new to HP-UX and am tired of pulling my hair out!
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2004 07:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2004 07:31 AM
02-19-2004 07:31 AM
Re: combine records in files
You get a little more format control with
pr -t -m FILEA FILEB > FILEC
man pr for details.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2004 07:48 AM
02-19-2004 07:48 AM
Re: combine records in files
merge.sh f1 f2,
where merge.sh looks like below and your merged file will be f3:
#!/bin/ksh
while read -u3 f1 && read -u4 f2; do
print "$f1" "$f2" >> f3
done 3<$1 4<$2
HTH,
Elena.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2004 08:53 AM
02-19-2004 08:53 AM
Re: combine records in files
In this particular case, the paste command worked perfectly, but I am printing out all the other solutions for future reference.