To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 2277
2276  |  2278
Subject: 
Re: Splitting text files.
Newsgroups: 
lugnet.off-topic.geek
Date: 
Mon, 6 Nov 2000 09:38:35 GMT
Viewed: 
145 times
  
guito wrote:

does anyone know of a way to split a text file into multiple
files based on the number of lines?  ie: 5000 lines split in
to five files of 1000 lines each.

If you're using a UNIX variant the split command will do this
for you.  i.e.

   split -l 1000 [filename]

Chris



Message has 2 Replies:
  Re: Splitting text files.
 
(...) Since this is a gnu tool, you can probably get this on many non-Unix platforms too. (24 years ago, 6-Nov-00, to lugnet.off-topic.geek)
  Re: Splitting text files.
 
(...) thanks! that worked beautifully. (24 years ago, 6-Nov-00, to lugnet.off-topic.geek)

Message is in Reply To:
  Splitting text files.
 
does anyone know of a way to split a text file into multiple files based on the number of lines? ie: 5000 lines split in to five files of 1000 lines each. i've been trying to figure out a way to do it with perl, but no luck so far. but any way to (...) (24 years ago, 6-Nov-00, to lugnet.off-topic.geek)

4 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR