- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to merge different files in one file?
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
Discussions
Discussions
Forums
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
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
тАО12-14-2007 02:29 AM
тАО12-14-2007 02:29 AM
How to merge different files in one file?
I am having 5 flat files say f1.out,f2.out,f3.out,f4.out,f5.out etc.
These files will be updated everyday. I want out put of all the files in one file say final.out. For that i am using below commands:
cat f1.out > final.out
cat f2.out >> final.out
cat f3.out >> final.out
cat f4.out >> final.out
cat f5.out >> final.out
I have to run these commands everyday.
But problem i am facing is that out put shows the content of f5.out only.
Can some one help me out that what is the correct way to do this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2007 02:47 AM
тАО12-14-2007 02:47 AM
Re: How to merge different files in one file?
You are running it manually or running through cron.
let me know if the issue is with manual execution also?
Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2007 02:51 AM
тАО12-14-2007 02:51 AM
Re: How to merge different files in one file?
cat f[1-5].out > final.out
Hasan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2007 02:55 AM
тАО12-14-2007 02:55 AM
Re: How to merge different files in one file?
your commands look ok to me.
Alternatively, you could do it like this:
# cat f1.out f2.out f3.out f4.out f5.out > final.out
but it will bring the same result; if it looks as if you get only the result of f5.out, it must be because the other files are empty.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2007 03:52 AM
тАО12-14-2007 03:52 AM
Re: How to merge different files in one file?
To concat all the files to the single file you have to run the command like below I have given.
cat file1 file2 file3 >> Outputfile
Make sure your files are not empty. If anyone of them is empty then you wont get some results in your output file.