HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- split files with formatted output name
Operating System - HP-UX
1833189
Members
3020
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-23-2004 06:59 AM
09-23-2004 06:59 AM
split files with formatted output name
Hi,
I have to split a big file into a number of smaller files. I know that split command will do the trick for me but my requirement is that the output files should be suffixed with 0,1,2,3...(example out1, out2, out3...) and not aa,ab like what split does.
Can anyone please help me.
Thanks,
Andy
I have to split a big file into a number of smaller files. I know that split command will do the trick for me but my requirement is that the output files should be suffixed with 0,1,2,3...(example out1, out2, out3...) and not aa,ab like what split does.
Can anyone please help me.
Thanks,
Andy
- Tags:
- split
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2004 07:08 AM
09-23-2004 07:08 AM
Re: split files with formatted output name
Here's a one line perl script. It will break up the files into 100 lines each.
cat bigfile | perl -pe 'open(STDOUT,">out".++$cnt) unless ($.-1) % 100;'
HTH
-- Rod Hills
cat bigfile | perl -pe 'open(STDOUT,">out".++$cnt) unless ($.-1) % 100;'
HTH
-- Rod Hills
There be dragons...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2004 07:10 AM
09-23-2004 07:10 AM
Re: split files with formatted output name
Or see if csplit(1) will work for you... it appends numbers instead of letters according to the man page.
--
Jeff Traigle
Jeff Traigle
- Tags:
- csplit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2004 07:14 AM
09-23-2004 07:14 AM
Re: split files with formatted output name
Hi Andy,
You might try the csplit command & use -f prefix. For example:
-f out
will result in out00 out01 out02 etc.
man csplit for further details.
HTH,
Jeff
You might try the csplit command & use -f prefix. For example:
-f out
will result in out00 out01 out02 etc.
man csplit for further details.
HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP