Putting One Word Per Line

Soldato
Joined
10 May 2004
Posts
3,790
Location
East Yorkshire, UK
Hi

Ive got a long list of words like this

slay sled slew slid

is it possible to change it to this format
slay
sled
slew
slid

as would take me years to do it manually?

Thanks
 
Im not a programmer as such, and this may be better put in the programming section because im sure a simple explode type statement on a string like that replacing the spaces with carriage returns would give you what you want.

Infact, if youve got the full string i will give it a go.
 
make a simple perl script with the line:

while(<>){
s/\s/\n/g;
print $_;
}

just put this in a file called newline.pl

then run it by putting in command prompt: "perl newline.pl < yourfile.extension > output.txt

this should work in windows. if not just email me the file - email in trust and i'll email it back with new lines.

daven

just read your post - here is the output with a newline for each word

http://rapidshare.com/files/93545299/output.txt.html
 
Last edited:
make a simple perl script with the line:

while(<>){
s/\s/\n/g;
print $_;
}

just put this in a file called newline.pl

then run it by putting in command prompt: "perl newline.pl < yourfile.extension > output.txt

this should work in windows. if not just email me the file - email in trust and i'll email it back with new lines.

daven

just read your post - here is the output with a newline for each word

http://rapidshare.com/files/93545299/output.txt.html


Thanks all, works great :)
 
Why not code something in Assembly?

Step 1:
Open MS Excel (or OO or whatever)

Step2:
Paste list

Step 3:
Copy list

Step 4:
Right Click > Paste special > Transpose

Talk about using a slegehammer!!
 
Back
Top Bottom