- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to veiw same file diff lines
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
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
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-15-2005 02:18 AM
09-15-2005 02:18 AM
Hi
I have a file ll.log
say thr is 1000 lines in this file. How i can extract 10 files each for seperate files.
cat,head and tail commbination is capable of doing only one group of lines at a time. is thr a command that can extract mulitple group of lines at the same time.
as if every file is too big it is taking a lot of time with cat head and tail.
Thank You
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 02:23 AM
09-15-2005 02:23 AM
Re: How to veiw same file diff lines
will create 10 output files with 100 lines from the input file in each.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 02:28 AM
09-15-2005 02:28 AM
Re: How to veiw same file diff lines
Sorry the lines numbers are differing for first few files it iwll be 10, some times it will be 18 and 47 also. there are 4 combinations 10,28,47,192
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 02:35 AM
09-15-2005 02:35 AM
Re: How to veiw same file diff lines
sed -n -e '1,5p' file will print only the lines from 1 to 5 and sed -n -e '5,10p' will print from 5 to 10.
You can use this in a shell script to print different portions of the file and than redirect the output to different output files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 02:55 AM
09-15-2005 02:55 AM
Re: How to veiw same file diff lines
Try split , it will split the file with 10 file of 100 lines each.
Here it is :
# split -l 100 file1 file2
The output will be named automatically as
file2aa
file2ab
file2ac
file2ad
file2ae
file2af
file2ag
file2ah
file2ai
file2aj
--------------
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2005 04:58 AM
09-15-2005 04:58 AM
Re: How to veiw same file diff lines
# sed '
> 1,10w 1.out
> 10,47w 2.out
> 18,47w 3.out
> 47,192w 4.out
> ' inputfile
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2006 01:52 AM
01-16-2006 01:52 AM