Hello all.
I'm writing a script to add some lines to about 1200 text files.
The script is done with one problem. I need to preserve the formatting in the orignial text files while adding the lines I need to add.
The original file is formatted with spaces, either 2, 4, 6 or 8 spaces before the first actual character in the line. I need to preserve this as I'm writing it out to a new file with the corrections.
The script works except for keeping the formatting, all leading spaces are removed. When I insert the 9 lines I need to add, I'm using space to add the lines. How the heck do I keep the leading spaces in the stuff I read in? (readline)
I'm writing a script to add some lines to about 1200 text files.
The script is done with one problem. I need to preserve the formatting in the orignial text files while adding the lines I need to add.
The original file is formatted with spaces, either 2, 4, 6 or 8 spaces before the first actual character in the line. I need to preserve this as I'm writing it out to a new file with the corrections.
The script works except for keeping the formatting, all leading spaces are removed. When I insert the 9 lines I need to add, I'm using space to add the lines. How the heck do I keep the leading spaces in the stuff I read in? (readline)