CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Randomizine lines and reoginize them

 



soeeom
New User

Jul 3, 2011, 10:44 PM

Post #1 of 2 (1835 views)
Randomizine lines and reoginize them Can't Post

Hi all, This isn't as easy as the title sounds Wink What I have (this is an experiment) A file containing something like the one below

Code
rbla blabla ( bla ) 
bla bla = bla
bla,bla


ok, crazy huh, well what I'm in need of doing is randomly placing a new line after each special character. So the outcome could be:

Code
rbla blabla (  
bla )
bla bla =
bla
bla,bla


or

Code
rbla blabla ( bla  
)
bla bla = bla
bla,
bla


and so on..
after this, i want it to be saved to it's original file. but the catch is, that next time it deals with the modified content it will rebuild it back to how it was in the very beginning, removing the new lines and putting them back to how they were originally, preventing it from being randomized twice.

thanks .. i know it's allot to ask, either this or i'll be posting on freelancers


BillKSmith
Veteran

Jul 4, 2011, 10:38 AM

Post #2 of 2 (1823 views)
Re: [soeeom] Randomizine lines and reoginize them [In reply to] Can't Post

It is impossible to undo the transformation because there is no way to tell new newlines from original ones. Why not make a back-up file? The existence of the back-up would tell you that the file had been processed at least once.
Good Luck,
Bill

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives