Jump to content

Recommended Posts

Posted

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!

Posted

should be " " (just white space).... I must be missing something to this question

I 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???

Posted

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)

:P

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...