Do you want to preserve "empty" lines or delete them ?
Here is an alternate biterscripting script with line-by-line control.
Code:
# Script LeadingWhiteSpaces.txt
var str file, content, line, output
cat $file > $content ; lex "1" $content > $line
# Go line by line.
while ($line <> "")
do
# Extract the line starting at the first printable char.
stex -r -c "[^.^" $line >> $output
lex "1" $content > $line
done
echo $output > { echo $file }
Run script as
Code:
script "LeadingWhiteSpaces.txt" file("C:/somefolder/somefile.cpp")
Will clean the file C:/somefolder/somefile.cpp of beginning white spaces ... assuming you saved the script in some folder in your $path as "LeadingWhiteSpaces.txt".
Bookmarks