Needle Posted August 6, 2011 Share Posted August 6, 2011 (edited) Hey guys ! I need to keep in file.txt many lines of the text , keeping all blanks and signs On similarity of it text <layout version="1.0"> <window x="2560" y="0" w="1609" h="1200" screen="1"> <splitter orientation="1"> <split size="1064"></split> <splitter orientation="1"> <split size="63"></split> <dock id="" hideTitles="1" activePageId="Toolbar.1"> <page id="Toolbar.1"></page> Thanks, excuse for my bad English Edited August 6, 2011 by Needle Link to comment Share on other sites More sharing options...
wakillon Posted August 6, 2011 Share Posted August 6, 2011 Which lines ? Can you show an initial text and a like you want text ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Needle Posted August 6, 2011 Author Share Posted August 6, 2011 (edited) I used FileWriteLine but it isn't convenient It is necessary for me all lines at once instead of on one The original text Root { inputs 0 name SideBySide_mov.nk format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)" proxy_type scale proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)" views "left #ff0000 right #00ff00" } I wrote so but it isn't convenient FileWriteLine($filem, "Root {") FileWriteLine($filem, " inputs 0") FileWriteLine($filem, " name SideBySide_mov.nk") FileWriteLine($filem, ' format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)" ') FileWriteLine($filem, " proxy_type scale") FileWriteLine($filem, ' proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"') FileWriteLine($filem, ' views "left #ff0000') FileWriteLine($filem, 'right #00ff00"') FileWriteLine($filem, "}") Thanks that you have responded Edited August 6, 2011 by Needle Link to comment Share on other sites More sharing options...
Zedna Posted August 6, 2011 Share Posted August 6, 2011 Look at StringRegExpReplace() and also search this forum for examples for its use. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Needle Posted August 6, 2011 Author Share Posted August 6, 2011 Excuse but I probably that that not absolutely I understand, I don't need that that to replace, I need to keep the text in a primordial form, without doing it to postfates with the help FileWriteLinein help Replace text in a string based on regular expressions.StringRegExpReplace ( "test", "pattern", "replace", [ count ] ) Link to comment Share on other sites More sharing options...
wakillon Posted August 6, 2011 Share Posted August 6, 2011 Do you mean this ? $_Text = "Root {" & @CRLF & _ " inputs 0" & @CRLF & _ " name SideBySide_mov.nk" & @CRLF & _ ' format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"' & @CRLF & _ " proxy_type scale" & @CRLF & _ ' proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)' & @CRLF & _ ' views "left #ff0000' & @CRLF & _ 'right #00ff00"' & @CRLF & _ "}" & @CRLF ConsoleWrite ( "$_Text : " & $_Text & @Crlf ) FileWrite ( $filem, $_Text ) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Needle Posted August 6, 2011 Author Share Posted August 6, 2011 wakillon Thanks but here also are present a description in manual hyphens, and it is handwork. It would not be desirable it Link to comment Share on other sites More sharing options...
wakillon Posted August 6, 2011 Share Posted August 6, 2011 wakillon Thanks but here also are present a description in manual hyphens, and it is handwork. It would not be desirable it AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Needle Posted August 6, 2011 Author Share Posted August 6, 2011 excuse for my bad English excuse excuse excuse excuse Link to comment Share on other sites More sharing options...
Developers Jos Posted August 6, 2011 Developers Share Posted August 6, 2011 excuse for my bad English excuse excuse excuse excuseNo need for that, just try to better explain what you want. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
wakillon Posted August 6, 2011 Share Posted August 6, 2011 excuse for my bad English excuse excuse excuse excuseTry Google Translate service ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Needle Posted August 6, 2011 Author Share Posted August 6, 2011 спасибо за помощь ваш вариант тоже не подходит так как придется делать работу руками добавляя & @CRLF & _ Thanks for your help option is also not suitable as hand will do the job by adding & @ CRLF & _ Link to comment Share on other sites More sharing options...
Needle Posted August 6, 2011 Author Share Posted August 6, 2011 (edited) similar Python example 1 string = """ bla bla bla """ example 2 string = """ Root { inputs 0 name SideBySide_mov.nk format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)" proxy_type scale proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)" views "left #ff0000 right #00ff00" }""" as will autoitscript ? excuse for my bad English Edited August 6, 2011 by Needle Link to comment Share on other sites More sharing options...
wakillon Posted August 6, 2011 Share Posted August 6, 2011 Please give 2 parts :1- Text before change2 - Text After change It will help to understand what you want ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Needle Posted August 6, 2011 Author Share Posted August 6, 2011 (edited) Here I am stupid how to type in the code SciTE dont use & @ CRLF & _ dont use FileWriteLine Edited August 7, 2011 by Needle Link to comment Share on other sites More sharing options...
Zedna Posted September 5, 2011 Share Posted September 5, 2011 (edited) Here I am stupid how to type in the code SciTEdont use & @ CRLF & _ dont use FileWriteLine I doubt there is no direct waybut there is indirect way for this. You can write your large multiline text to separate TXT file and then add this file as resource fileit will be included in your compiled EXE file.At runtime you can load this large multiline TXT file by _ResourceGetAsString() Look at my Resources UDF: Edited September 5, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search 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