- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: split command not splitting a 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
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
тАО03-03-2009 10:35 PM
тАО03-03-2009 10:35 PM
split command not splitting a file
Any suggstion?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2009 10:55 PM
тАО03-03-2009 10:55 PM
Re: split command not splitting a file
file voda
wc -l voda
and:
wc -l xaa
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2009 11:41 PM
тАО03-03-2009 11:41 PM
Re: split command not splitting a file
voda.txt: ascii text
$ wc -l voda.txt
196 voda.txt
(it seemms to be wrong, this file has many many lines. See the file size below)
-rw-rw-rw- 1 root sys 2517645178 Mar 3 16:52 voda.txt
# wc -l xaa
156 xaa
( I have terminated the file as it is continuing)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2009 12:02 AM
тАО03-04-2009 12:02 AM
Re: split command not splitting a file
Please remember that tools like "vi" or "more" will wrap long lines into multiple shorter lines *on screen only*.
Alternatively, the file might have non-standard line terminator characters. If so, no Unix tool will recognize the lines correctly until the file is run through an appropriate converter.
I recommend you use "split -b" and specify the size in bytes, not in lines. This will avoid any problems with line termination characters.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2009 12:54 AM
тАО03-04-2009 12:54 AM
Re: split command not splitting a file
then only one file with data is creating 'xaa', other files xab,etc though have created with size 50000000 bytes but those files are not showing ( with vi) any data inside of the file. These files are blank. If I onen any file with 'vi', it is showing "xat" Line too long, but no data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2009 01:05 AM
тАО03-04-2009 01:05 AM
Re: split command not splitting a file
Try this example
In this simple example, assume myfile is 3,000 lines long:
split myfile
This will output three 1000-line files: xaa, xab, and xac.
Working on the same file, this next example is more complex:
split -l 500 myfile segment
This will output six 500-line files: segmentaa, segmentab, segmentac, segmentad, segmentae, and segmentaf.
Finally, assume myfile is a 160KB file:
split -b 40k myfile segment
This will output four 40KB files: segmentaa, segmentab, segmentac, and segmentad.
of visit this site
http://www.unix.com/shell-programming-scripting/14576-split-file-using-awk.html
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2009 03:20 AM
тАО03-04-2009 03:20 AM
Re: split command not splitting a file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2009 09:31 AM
тАО03-04-2009 09:31 AM
Re: split command not splitting a file
using vi isn't reliable in the context as 1) it doesn't appear that it really is an ascii file ("file" guesses based on some magic values)
2) it seems to be composed of a few, very long lines, which vi is going to complain about.
you might try "cat"ing the results back together and then "diff" them w/ the original to if they are indeed correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2009 10:28 AM
тАО03-04-2009 10:28 AM
Re: split command not splitting a file
http://docs.hp.com/en/5965-4406/ch04s09.html#interfaces-commands
>OldSchool: you might try "cat"ing the results back together
Yes, that will prove split works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-04-2009 04:48 PM
тАО03-04-2009 04:48 PM
Re: split command not splitting a file
split -b 1m /stand/vmunix vm