Split text file with AmigaDOS commands

DoctorQ

Member
Joined
Dec 16, 2007
Posts
391
Country
Denmark
Hi,

I need some help with AmigaDOS scripting. I have multiple text files that I would like to create a simple editor for, for instance my Startup-Sequence, User-Startup, etc. I know I can use an editor like ED, CED, etc, but the goal is to have a tool where I can select the file through GUI (RequestFile), and then edit only one particular line in the script.

An example. I have a text file called test.txt with the following contents

Line 1 echo "Welcome"
Line 2 echo "to"
Line 3 echo "this"
Line 4 echo "test"

I now want to edit line 4 to something else. In order to do that, with the way I'm thinking of doing it, I need to split the file into text files containing one line each, or into variables containing one line each, that I can call later in my script. I'm thinking that I will build the new file by either joining the split files or typing the split files to a new file, like type splitline1.txt >>newtest.txt, type splitline2.txt >>newtest.txt, etc.

My question is; how do I split my file called test.txt into seperate text files, containing only one line each?

Thanks in advance.

- - - Updated - - -

Found this little program that can split my file as wanted; http://aminet.net/package/util/sys/Split1_0

If it can be done without any third party programs I would still like to know how :)
 
Back
Top Bottom