Joppe Posted October 18, 2007 Share Posted October 18, 2007 Hello I`m making a small script at work. Never done this before, so going slowly. I have made a Gui, were i paste in some information that we get on mail. The mail system that we use on work makes an anyoing blank space after the last charachter on each line. This is again causing some trouble when i use the information. Say i get John Smith on a line , and im gonna use that line to make an email adress, it comes out like a invalid email adress for me : John.Smith @gmail.com So im wondering is there anyway to remove that "blank" space after the end of each line ? Can`t post all my code as it getting pretty big , but here i what i use to put the information into a .txt file, It may be this can be done when extracting the info from the file after also , as i said im no expert ;p Do $Msg = GuiGetMsg() If $msg = $GenKnapp Then GuiSetState(@SW_DISABLE,$WinMain) $s_Adbrukernavn = GuiCtrlRead($Adbrukernavn) $s_LdapPass = GuiCtrlRead($LdapPass) $s_EditText = GuiCtrlRead($EditText) $s_Adidle = GuiCtrlRead($Adidle) $s_Adtimeout = GuiCtrlRead($Adtimeout) GuiSetState(@SW_ENABLE,$WinMain) $lagring = FileOpen("mail.txt",2) If $lagring = -1 Then MsgBox(0, "Error", "Unable to open file.") Return EndIf FileWrite($lagring, $s_EditText) FileClose($lagring) Opprett() EndIf If $KunMailKnapp Then ; Email() EndIf If $msg = $AvsluttKnapp Then Exit EndIf Until $msg = $GUI_EVENT_CLOSE; EndFunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 18, 2007 Moderators Share Posted October 18, 2007 StringStripWs Or If StringRight($sText, 1) = " " Then $sText = StringTrimRight($sText, 1) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BrettF Posted October 18, 2007 Share Posted October 18, 2007 StringStripWS will be your friend... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Joppe Posted October 18, 2007 Author Share Posted October 18, 2007 Thank you guys, that did the trick 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