Gnat Posted November 20, 2007 Share Posted November 20, 2007 I have searched the help file and the forums, and maybe I am just missing it...but, is there a command to insert a blank space or multiple blank spaces into a text file? I am trying to format a text file, and @TAB isn't doing it for me because of the random string lengths... Thanks in advance! Link to comment Share on other sites More sharing options...
DW1 Posted November 20, 2007 Share Posted November 20, 2007 should be " " (just white space).... I must be missing something to this question AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Gnat Posted November 20, 2007 Author Share Posted November 20, 2007 should be " " (just white space).... I must be missing something to this questionI have a text file that is being created by a script. The text file has multiple columns that have various length strings and with tabs the columns may or may not line up properly. So, I am subtracting the string length from the column width that I want to use and I want to then add that number of spaces at the end of the text string. Is this possible??? Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 20, 2007 Share Posted November 20, 2007 I have searched the help file and the forums, and maybe I am just missing it...but, is there a command to insert a blank space or multiple blank spaces into a text file? I am trying to format a text file, and @TAB isn't doing it for me because of the random string lengths... Thanks in advance! Demo: Inserts one space at character 11 of the 5th line: #include <file.au3> $sFile = "C:\Temp\Test.txt" $sLine = FileReadLine($sFile, 5) $sLine = StringLeft($sLine, 10) & " " & StringMid($sLine, 11) _FileWriteToLine($sFile, 5, $sLine, 1) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Valuater Posted November 20, 2007 Share Posted November 20, 2007 demo to add spaces acording to a set length $String1 = "this is how long I want the string string" $String2 = "this is short" $Length_wanted = StringLen($String1) $Length2 = StringLen($String2) for $x = $Length2 to $Length_wanted -1 $String2 = $String2 & " " Next MsgBox(0x0,"Result", "String Length #1 = " & $Length_wanted & @CRLF & "String Length #2= " & StringLen($String2) & " ") 8) 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