Fortitude Posted June 27, 2018 Share Posted June 27, 2018 Hello! I'm making a program with autoIT where i put down a Editbox (with KodaGUI) and i need to split the input data from that, by newline. Until now i did the splitting with space ( " " ), but i need to split with newline. tried with "\n" but didnt work and i'm not sure how to do properly with "@CR or @CRFL or @FL".. I tried to change for these, but its making weird outputs. Here is my Codepart: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Convert_kivalaszt $Edit1_data = GUICtrlRead($Fajlok_edit) Case $Convert_button Global $Userdata = StringSplit( $Edit1_data, " ") .... .. Link to comment Share on other sites More sharing options...
Subz Posted June 27, 2018 Share Posted June 27, 2018 Usually just need to split by @LF, if you copy text into something like NotePad++ and turn on symbols you'll notice the CRLF symbols in the text when there is a new line. AnonymousX 1 Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted June 27, 2018 Share Posted June 27, 2018 Good morning @Fortitude, and welcome to the AutoIt forum Quote Until now i did the splitting with space ( " " ), but i need to split with newline. If you write in your Edit some text, new line, and write some other text, and copy this text and paste to Notepad++ ( for example ), you will notice that at the end of the line, the character @CRLF is added. So, what you have to do, is something like this: Local $strReadFromEdit = "This" & @CRLF & "is" & @CRLF & "text", _ ; From the Help file about StringSplit(): $arrReadFromEdit = StringSplit($strReadFromEdit, @CRLF, BitOr($STR_NOCOUNT, $STR_ENTIRESPLIT)) ; Note that the macro @CRLF is actually a 2 character string, so unless the flag ; parameter to $STR_ENTIRESPLIT extra blank lines will be generated as the string ; is split on both @CR and @LF. _ArrayDisplay($arrReadFromEdit) Always take a look at the Help file before posting something here! Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Fortitude Posted June 27, 2018 Author Share Posted June 27, 2018 Thank you guys for help, my problem is solved. I did check the Help, but could'nt figure out what's wrog, now all clear. 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