- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: split a file into 5 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
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
тАО09-28-2004 10:56 PM
тАО09-28-2004 10:56 PM
split a file into 5 files
I have a log file whith 30 MB
I need to split the into 5 files more smalls
Can you help me?
Thanks, Joel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2004 11:04 PM
тАО09-28-2004 11:04 PM
Re: split a file into 5 files
as the name implies - just use the "split" command which splits the original file in different pieces according to your inputs
(see man split for more details)
Regards
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2004 11:08 PM
тАО09-28-2004 11:08 PM
Re: split a file into 5 files
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2004 11:22 PM
тАО09-28-2004 11:22 PM
Re: split a file into 5 files
If you need more control, like having a certain pattern on the line to split on (before/after), use csplit, which takes context into consideration
# man csplit
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2004 11:40 PM
тАО09-28-2004 11:40 PM
Re: split a file into 5 files
only generates a file:
109002 Sep 29 12:40 xaa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2004 11:55 PM
тАО09-28-2004 11:55 PM
Re: split a file into 5 files
Can u try it
regrads
SK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2004 12:15 AM
тАО09-29-2004 12:15 AM
Re: split a file into 5 files
In fact I have such logs /30-40MB/, but I decide to separate parts of these logs day by day and to keep it detached hierarhy directory day-by-day /year/mount/day/log.
For example: /2004/09/21/system1_20040921.log.
/2004/09/22/system1_20040922.log
and so on.
I'm attaching you my 2 scripts like a tools to do this. 1st of them separated current day part of log of system1 and send them to system2 by ftp. 2nd script organize keeping
logs of system1 in hierarchy, mentioned above,on system2.
Regards,Stan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2004 12:16 AM
тАО09-29-2004 12:16 AM
Re: split a file into 5 files
bdf
df
so that do you have enough space to do this operation. It will create new files so that it will occupy memory there in the file system.
cd into another file system which is having more memory there and try as
split -b 6m
so that it will create new files in new directory there only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2004 01:03 AM
тАО09-29-2004 01:03 AM
Re: split a file into 5 files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2004 01:21 AM
тАО09-29-2004 01:21 AM
Re: split a file into 5 files
Here is syntax which may help you.
Say your file has 1024bytes, and you want to make five parts of it.
split -b 204 (bytes) filename
this should be making it five parts. and it will be named as xaa xab ...
I have tried it and it works fine. I have devided a file in two pieces and also in 116 parts.
Hope this helps
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2004 01:39 AM
тАО09-29-2004 01:39 AM
Re: split a file into 5 files
How big was the test file you used (file x) ?
If it was less then your split size then its only going to generate one file for you.
Best regards,
Kent M. Ostby