Computing.Net > Forums > Disk Operating System > Splitting a text file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Splitting a text file

Reply to Message Icon

Name: yaffle42
Date: July 14, 2005 at 03:11:10 Pacific
OS: Win 98
CPU/Ram: Celeron 128Mb
Comment:

Hi,

I am having trouble creating a batch file to break down a text file into several smaller text files.

I have a text file that consists:

%MPFxxx
abc
def 123
ghj dfg 321
.
.
123 khl hjk
sdf gke 456
%MPFxxx
jhj 335
dgj
.
.
etc,

I need to start at the first %MPFxxx and copy that line and all subsequent lines until the next %MPFxxx line into a new file. Then do the same starting at the next %MPF. And repeat until the end of the file.

Each %MPFxxx is numbered uniquely but non-sequential.

I had managed to do this in the XP command prompt using FOR /F but I have just found it is needed for a WIN98 machine so I need to start afresh.

Cheers




Sponsored Link
Ads by Google

Response Number 1
Name: wizard-fred
Date: July 14, 2005 at 07:12:56 Pacific
Reply:

A short BASIC program will work wonders.


0

Response Number 2
Name: yaffle42
Date: July 21, 2005 at 03:49:53 Pacific
Reply:

Thanks for that. I got to hung up in trying to do it in a batch file I forgot to consider that. It is done now.

Cheers


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Splitting a text file

Read a text file into a batch pgm? www.computing.net/answers/dos/read-a-text-file-into-a-batch-pgm/8760.html

Getting Contents of a Text File www.computing.net/answers/dos/getting-contents-of-a-text-file/13123.html

store processing result in a text file www.computing.net/answers/dos/store-processing-result-in-a-text-file/7409.html