xOAT Posted September 25, 2009 Share Posted September 25, 2009 So for example I have a text file that reads: This-is-on-line-one+two+three How do I replace the "+" with a new line so that the file turns into: This-is-on-line-one two three Link to comment Share on other sites More sharing options...
Mecrazycoder Posted September 25, 2009 Share Posted September 25, 2009 So for example I have a text file that reads: This-is-on-line-one+two+three How do I replace the "+" with a new line so that the file turns into: This-is-on-line-one two three Its work for me.Try it out $text = StringReplace("This-is-on-line-one+two+three", "+", @CRLF) MsgBox(0,"",$text) [size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent] Link to comment Share on other sites More sharing options...
xOAT Posted September 25, 2009 Author Share Posted September 25, 2009 Its work for me.Try it out $text = StringReplace("This-is-on-line-one+two+three", "+", @CRLF) MsgBox(0,"",$text) Aww, I see. I was using @LF for changing the file; which doesn't work. The help file doesn't say to use @CRLF instead. It's confusing using @CR, @LF, and @CRLF on diff. commands for the same outcome. Thanks for the help. Link to comment Share on other sites More sharing options...
bo8ster Posted September 25, 2009 Share Posted September 25, 2009 (edited) They are not the same. One is '\r' (@CR), the other is '\n' (@LF). Windows likes to use '\n' or "\n\r". You will notice @CR also works using StringReplace. Edited September 25, 2009 by bo8ster Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
Mecrazycoder Posted September 25, 2009 Share Posted September 25, 2009 Aww, I see. I was using @LF for changing the file; which doesn't work. The help file doesn't say to use @CRLF instead. It's confusing using @CR, @LF, and @CRLF on diff. commands for the same outcome. Thanks for the help.You are welcome.I think @CR alone will also be working. But it is good practice to use @CRLF for windows. Unix-like systems use "\n" and MacOS 9 uses "\r". [size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent] Link to comment Share on other sites More sharing options...
jvanegmond Posted September 25, 2009 Share Posted September 25, 2009 You are welcome.I think @CR alone will also be working. But it is good practice to use @CRLF for windows. Unix-like systems use "\n" and MacOS 9 uses "\r".http://en.wikipedia.org/wiki/Newline#Representations github.com/jvanegmond Link to comment Share on other sites More sharing options...
Mecrazycoder Posted September 25, 2009 Share Posted September 25, 2009 are you sure about this?I am not 100% sure. Why? is there anything wrong in it? [size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent] Link to comment Share on other sites More sharing options...
jvanegmond Posted September 25, 2009 Share Posted September 25, 2009 I am not 100% sure. Why? is there anything wrong in it?You just replied to a spam bot. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Mecrazycoder Posted September 25, 2009 Share Posted September 25, 2009 You just replied to a spam bot.Oh tanx man.. But how did you find that(Spam bot) [size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent] Link to comment Share on other sites More sharing options...
jvanegmond Posted September 25, 2009 Share Posted September 25, 2009 Oh tanx man.. But how did you find that(Spam bot)1. Link to advertising in signature2. Generic and useless reply3. Just one post. He registered to ask you if you were sure? I think that is a little too much trouble..4. Smiley face as post icon, no one uses post icons on these forums... l o l. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Mecrazycoder Posted September 25, 2009 Share Posted September 25, 2009 1. Link to advertising in signature2. Generic and useless reply3. Just one post. He registered to ask you if you were sure? I think that is a little too much trouble..4. Smiley face as post icon, no one uses post icons on these forums... l o l.Oh great tanx man. You are rocking [size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent] 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