in reply to Search and Replace

Assuming your file is called "tt.txt" then this should do the job when run from the command line:
perl -pi -e's/~/\n/g' tt.txt
You might want to look at the perlrun and perlre manpages for more information on what is going on there.
/J\