- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Reassembling files broken-up by "split"
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
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
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
тАО05-31-2005 02:07 PM
тАО05-31-2005 02:07 PM
May I know what is the utility in UNIX which allows me to reassemble all files that were broken-up in chunks by the "split" utility?
I had broken-up the original file using "split", with the following options:
# split -b 1024 testFile.log
which had generated the x** files (xaa, xab, etc...)
The purpose of this question is solely educational, as I would like to know the techniques of reassembling the x**, should the original(testFile.log) go missing or got deleted by accident.
Thanks in advance.
Danny
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 02:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 02:46 PM
тАО05-31-2005 02:46 PM
Re: Reassembling files broken-up by "split"
You can use following command for reassembling
#cat xaa xab xac xad ... >testFile1.log
Enjoy!!!
Eknath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 05:14 PM
тАО05-31-2005 05:14 PM
Re: Reassembling files broken-up by "split"
> newfile
for file in `ls xa*`
do
cat $file >>
done
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 01:50 PM
тАО06-01-2005 01:50 PM
Re: Reassembling files broken-up by "split"
I tried the method below as suggested in the replies to this thread:
#!/bin/sh
for i in `ls x*`
do
echo $i
cat $i >> myFile
done
However, the "diff" operation between the original file and newly concatenated file seem to differ (see output below):
[clownfish] /users/leawc> diff myFile template.tar
Binary files myFile and template.tar differ
I performed a split on a "tar" file and I'm now attempting to reassemble them.
I had also used the same script above for concatenating ordinary text files which were broken into smaller chunks, and found that they differ too (See output below - note that the original file is xml_creator.log, and the myFile is the concatenated files):
[clownfish] /users/leawc/TEMP3> diff xml_creator.log myFile
80a81,160
> [Wed 11-Aug-2004 16:09:06 SGT] STARTING xml_creator.ksh -source Ericsson STP v1.0 -detail -file loztest.xml -allnc -verbose
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Exporting attributes...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing STP attributes...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing SS7_Link attributes...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing SS7_LinkSet attributes...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing Node attributes...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Exporting busy hours...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing SS7Link_Discard_BH...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Exporting KPIs...
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing STP.Ericsson.SS7.STP KPIs...
> [Wed 11-Aug-2004 16:09:06 SGT] WARNING: The STP.Ericsson.SS7.STP KPIs are not linked to any raw table columns.
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing SS7_Link.Ericsson.SS7.Link KPIs...
> [Wed 11-Aug-2004 16:09:06 SGT] WARNING: The SS7_Link.Ericsson.SS7.Link KPIs are not linked to any raw table columns.
> [Wed 11-Aug-2004 16:09:06 SGT] INFO: Processing SS7_LinkSet.Ericsson.SS7.LinkSet KPIs...
> [Wed 11-Aug-2004 16:09:06 SGT] WARNING: The SS7_LinkSet.Ericsson.SS7.LinkSet KPIs are not linked to any raw table columns.
> [Wed 11-Aug-2004 16:09:07 SGT] FINISHED xml_creator.ksh
>
>
> [Thu 12-Aug-2004 09:51:22 SGT] STARTING xml_creator.ksh -source Ericsson STP v1.0 -detail -file loztest.xml -allnc -verbose
> [Thu 12-Aug-2004 09:51:22 SGT] INFO: Exporting NC tables...
> [Thu 12-Aug-2004 09:51:22 SGT] INFO: Processing nc_stp table...
> [Thu 12-Aug-2004 09:51:22 SGT] INFO: Processing nc_ss7_link table...
> [Thu 12-Aug-2004 09:51:22 SGT] INFO: Processing nc_ss7_linkset table...
> [Thu 12-Aug-2004 09:51:22 SGT] INFO: Processing nc_node table...
> [Thu 12-Aug-2004 09:51:22 SGT] INFO: Exporting raw tables...
> [Thu 12-Aug-2004 09:51:22 SGT] INFO: Processing ericsson_ss7_link_link_1_raw table...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing ericsson_ss7_link_link_2_raw table...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing ericsson_ss7_linkset_linkset_raw table...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing ericsson_stp_stp_raw table...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Exporting attributes...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing STP attributes...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing SS7_Link attributes...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing SS7_LinkSet attributes...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing Node attributes...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Exporting busy hours...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing SS7Link_Discard_BH...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Exporting KPIs...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing STP.Ericsson.SS7.STP KPIs...
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing SS7_Link.Ericsson.SS7.Link KPIs...
> [Thu 12-Aug-2004 09:51:23 SGT] WARNING: The mapping for the SS7_Link.Ericsson.SS7.Link MSUDISC0_PC KPI is in an unexpected format.
> [Thu 12-Aug-2004 09:51:23 SGT] INFO: Processing SS7_LinkSet.Ericsson.SS7.LinkSet KPIs...
> [Thu 12-Aug-2004 09:51:23 SGT] FINISHED xml_creator.ksh
>
>
> [Thu 12-Aug-2004 10:12:42 SGT] STARTING xml_creator.ksh -package all -detail -file all.xml -verbose
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Exporting NC tables...
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Processing nc_stp table...
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Processing nc_ss7_link table...
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Processing nc_ss7_linkset table...
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Processing nc_node table...
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Exporting raw tables...
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Processing ericsson_ss7_link_link_1_raw table...
> [Thu 12-Aug-2004 10:12:42 SGT] INFO: Processing ericsson_ss7_link_link_2_raw table...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing ericsson_ss7_linkset_linkset_raw table...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing ericsson_stp_stp_raw table...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Exporting attributes...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing STP attributes...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing SS7_Link attributes...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing SS7_LinkSet attributes...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing Node attributes...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Exporting busy hours...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing SS7Link_Discard_BH...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Exporting KPIs...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing STP.Ericsson.SS7.STP KPIs...
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing SS7_Link.Ericsson.SS7.Link KPIs...
> [Thu 12-Aug-2004 10:12:43 SGT] WARNING: The mapping for the SS7_Link.Ericsson.SS7.Link MSUDISC0_PC KPI is in an unexpected format.
> [Thu 12-Aug-2004 10:12:43 SGT] INFO: Processing SS7_LinkSet.Ericsson.SS7.LinkSet KPIs...
> [Thu 12-Aug-2004 10:12:43 SGT] FINISHED xml_creator.ksh
>
>
> [Thu 12-Aug-2004 11:22:19 SGT] STARTING xml_creator.ksh -package all -file all.xml
> [Thu 12-Aug-2004 11:22:19 SGT] INFO: Exporting NC tables...
> [Thu 12-Aug-2004 11:22:19 SGT] INFO: Exporting raw tables...
> [Thu 12-Aug-2004 11:22:19 SGT] INFO: Exporting attributes...
> [Thu 12-Aug-2004 11:22:19 SGT] INFO: Exporting busy hours...
> [Thu 12-Aug-2004 11:22:20 SGT] INFO: Exporting KPIs...
> [Thu 12-Aug-2004 11:22:20 SGT] WARNING: The mapping for the SS7_Link.Ericsson.SS7.Link MSUDISC0_PC KPI is in an unexpected format.
> [Thu 12-Aug-2004 11:22:20 SGT] FINISHED xml_creator.ksh
>
>
Therefore, the filesizes differ for the both files after the concatenation.
[clownfish] /users/leawc/TEMP3> du -sk myFile
12 myFile
[clownfish] /users/leawc/TEMP3> du -sk xml_creator.log
8 xml_creator.log
Could anyone help me out?
Thanks
Danny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 02:34 PM
тАО06-01-2005 02:34 PM
Re: Reassembling files broken-up by "split"
cat x* > mybigfile
Mybigfile is then automatically reassembled in the correct order. A much better test for comparing files is cksum or sum. Diff cannot be used on files which contain binary data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 11:48 PM
тАО06-01-2005 11:48 PM
Re: Reassembling files broken-up by "split"
this sounds like you accidently put one or more splitfiles several times in your newly joined file.
Just use cat x* > newfile as those files are created in the rigth order so globing will use them correctly.
By the way, whens splitting textfiles like your logs i always use split -l for line_count. This results in more readable files as they are split on complete lines only.
Hope this helps.
Regards Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 03:19 AM
тАО06-02-2005 03:19 AM
Re: Reassembling files broken-up by "split"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 03:26 AM
тАО06-02-2005 03:26 AM
Re: Reassembling files broken-up by "split"
cat $i >> myFile
If you run the command more than once, it won't work the way you might think. You should truncate the file before re-use, or use A. Clay Stephenson's suggestion instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2005 01:32 PM
тАО06-02-2005 01:32 PM
Re: Reassembling files broken-up by "split"
Thanks everyone. Issue resolved.