Splitting text into files?

Suspended
Joined
17 Oct 2011
Posts
5,707
Location
Buckingamshire
I have a .txt that is full of individual messages. The messages are clearly demarked with a unique start and end - #*Conversation*# and #*End of Conversation*#.

What I want to do is to copy out each message between that start and end text and save it to individual text files.

What's the best way of going about that please?
 
Thanks for those examples. I shall have a play about with those and see if I can get them to work. I'm amazed there isn't a Windows tool that does this. Provide the source, detail the start and end delimiters and specify the output type and off it goes...
 
Thanks Pho.

So the data is resident in a .txt and the delimiters are:

#*Conversation*#
#*End of Conversation*#

I just need everything between each instance of those copied into a new .txt until it reaches the bottom of the original and stops. That's it. Thanks :)
 
Right, tried it and not sure if I am doing something wrong, but running the executable causes a command prompt window to appear for a second then disappear. The file input.txt is in the same directory as the executable.
 
Last edited:
Back
Top Bottom