Below is the script that I got from:
http://www.experts-exchange.com/Q_23561753.html I run it as a macro from excel and creates output files.
However its output and the the original file I was trying to emulate are different:
I need the following problems to be fixed:
this line of script:
vbtab & "# CELLS" & vbtab & "BEGIN" & vbtab & "END" & vbtab & "BEGIN" & vbtab & "END")
results in this:
RGNVAL REGION NAME # CELLS BEGIN END BEGIN END
There needs to be 10 spaces between RGNVAL and REGION NAME, 4 spaces between REGION NAME and # CELLS, 6 spaces between # CELLS and BEGIN, 8 spaces between BEGIN and END, 6 space between END and BEGIN, and 8 spaces between BEGIN and END - Like this:
RGNVAL REGION NAME # CELLS BEGIN END BEGIN END
Problem 2:
I need:
34 spaces before LANDUSE STATE 1 and 7 spaces between LANDUSE STATE 1 and LANDUSE STATE 2
Problem 3:
The Spaces Between the values to be inserted are also specific:
For example from three outputs:
from output for 001:
RGNVAL REGION NAME # CELLS BEGIN END BEGIN END
1 Region 1 294276 138334 119057 92883 112160
5 spaces (before 1), 13 spaces (between 1 and Region 1), 5 spaces (between Region 1 and 1st value), 5 spaces (between 1st and 2nd value), 5 spaces (between 2nd and 3rd value), 6 spaces (between 3rd and 4th value), 5 spaces (between 4th and 5th value)
from output 064:
RGNVAL REGION NAME # CELLS BEGIN END BEGIN END
1 Region 1 294276 11690 83 219419 231026
5 spaces, 13 spaces, 5 spaces, 6 spaces, 9 spaces, 5 spaces, 5 spaces
from output 074:
RGNVAL REGION NAME # CELLS BEGIN END BEGIN END
1 Region 1 294276 174357 148695 56763 82425
5 spaces, 13 spaces, 5 spaces, 5 spaces, 5 spaces, 6 spaces, 6 spaces
It appears that the number of spaces depends on the number of digits in the value so if the next value has 6 digits, the number of spaces is 5, if it has 5 digits the number of spaces is 6, if the number has 2 digits the number of spaces is 9, etc
It looks like the spacing is correct from the rest of the output.
Please advise,
MJ
Start Free Trial