[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Splitting up a text file



Hi there-

Okay... a very newbie question. Please don't flame me!

I would like to write a MacPerl script which will help do the following....

        Say I have an ASCII text file with about 40,000 or more lines. I'd
        like to split that file into smaller files, each with 10,000
        lines.

I'm sure this is possible with MacPerl, but I am not sure where to start.
The number 40,000 is just an example. In reality, the number might be
larger or smaller for any given file. The number 10,000 could be fixed.

(Basically, I want to use these large text files in Excel. Of course, Excel
has a 16,000 row limit. So, I'd like to split the big files into small,
more-workable files.)

The next step would be to select rows with a given criteria. That is, if
column 4-6 "123" then keep the line, etc.

I'd really appreciate any help you can give - especially with the first
part. The criteria part can wait.

Thanks!

-Bill

-----------------------------------------------------------------------------
Bill Dennen                                         email: wjdennen@colby.edu
Macintosh Applications Specialist                   phone: 207/872-3415
Colby College                                         fax: 207/872-3555
4213 Mayflower Hill
Waterville, ME   04901