olirav Posted June 15, 2010 Share Posted June 15, 2010 (edited) I am building a small program that processes an directory of images and creates a basic html file for themI have the code that gets the directory in the format:1.jpg2.jpgand copies it to the clipboard. Then this script should process it (1st stage)$bak = ClipGet() $writefile = FileOpen ("C:\Website\images.html", 2) $FileContent=StringReplace($bak,".jpg", ".jpg"/>"&@CRLF) FileDelete($writefile) FileWrite($writefile,$FileContent)However the new line (@crlf) doesn't workI had previously got it working in word with these two find and replace searches (fairly slow).jpg -> .jpg"/>^l<img width="150" height="120" src="../image//image/^p -> /image/(and a couple more to clean up, but those two are the important ones)The regular expressions (From Word) are: ^l = manual line ^p = paragraph characterHow can I use autoit to use these replace searches.Oli Edited June 15, 2010 by olirav Link to comment Share on other sites More sharing options...
Zibit Posted June 15, 2010 Share Posted June 15, 2010 theres alot easier ways. i would use fileread and stringreplace becouse im not sure fileopen works that way. Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
bogQ Posted June 15, 2010 Share Posted June 15, 2010 (edited) Use ' instead " Probably StringReplace($bak,'.jpg"', '.jpg"/>'&@CRLF) Edited June 15, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
olirav Posted June 15, 2010 Author Share Posted June 15, 2010 (edited) Use ' instead " Probably StringReplace($bak,'.jpg', '.jpg"/>'&@CRLF) Im afraid that only gives 1.jpg"/> 2.jpg"/> 3.jpg"/> I need 1.jpg"/> 2.jpg"/> 3.jpg"/> In the html file - still no line break Edited June 15, 2010 by olirav Link to comment Share on other sites More sharing options...
bogQ Posted June 15, 2010 Share Posted June 15, 2010 Try @CR or @LF What char do replicate new row in HTML? I dont have problems when dooing it in notepad, dont see how it cant work in HTML. With what program (editor) do you check that new row r correct or not? TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
olirav Posted June 15, 2010 Author Share Posted June 15, 2010 Try @CRor@LFWhat char do replicate new row in HTML?I dont have problems when dooing it in notepad, dont see how it cant work in HTML.With what program (editor) do you check that new row r correct or not?I have just found out that the new line is working (I made the mistake of using firefox to view the file (forgot it was html not txt)Thanks, I've got the rest to work now as well, thank you for helping me see my silly mistake.oli Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now