Advertisement

04.23.2008 at 08:03PM PDT, ID: 23349033
[x]
Attachment Details

Help with iterative text - script

Asked by mgjust in VB Script, Python Scripting Language, Windows Batch Scripting

Tags: VBScript, Python, Windows Batch

Hello,
Below I copied a text file (.gmd extension).
I would like to be able to recreate this several times being able to change some of the values. Each files needs to be save with the counter (075-407 attached and a .gmd extension)



....
NAME OF INITIAL LANDUSE IMAGE           :    gr_lc_01b_075_fp
SUITABILITY IMAGE FOR SIMULATION 1      :    c2_mce_075

These should change together: gr_lc_01b_XXX_fp & c2_mce_XXX  (XXX goes from 075 - 407)
....

RGNVAL          REGION NAME    # CELLS      BEGIN        END      BEGIN        END
     1             Region 1     294276     152838     140000      78439      91277

Each of these four numbers will be different for each iteration from 074-407. I have them right now in an excel file.  Please advise how to incorporate this into the script.
.....

NAME OF OUTPUT LANDUSE IMAGE            :    delete_test

I would like the output name to be updated with the number from the iteration (075-407, e.g. output_075)

.....

Thank you kindly,
I really appreciate annotated code so that I might one day now how to do this myself,
Cheers,
MJ



text that needs to be copied and or updated starts immediately below:

***************************************************************
* THIS FILE CONTAINS THE VALUES OF THE PARAMETERS REQUIRED    *
* FOR THE GEOMOD MODULE, WHICH AUTOMATICALLY IS GENERATED IN  *
* IDRISI. STRONGLY RECOMMEND REEDITING IN IDRISI IF NECESSARY.*
***************************************************************

TIME TO BEGIN GEOMOD, INCLUSIVE         :    2001
TIME TO END GEOMOD, INCLUSIVE           :    2016
TIME STEP IN TIME UNITS                 :    1

# NEIGHBORS AWAY TO SEARCH,0=NO NIBBLE  :    1
WRITE DEBUG OUTPUT TO LOG FILE,YES=1    :    0
NAME OF STRATA/MASK IMAGE               :    N/A
NAME OF INITIAL LANDUSE IMAGE           :    gr_lc_01b_075_fp
DO ENVIR. IMPACT ANALYSIS? 1=YES, 0=NO  :    0
CMP/READ SUITABILITY SCORES(0=CP,1=RD)  :    1
NUMBER OF RUNS ONCE                     :    1
SUITABILITY IMAGE FOR SIMULATION 1      :    c2_mce_075
DO VALIDATION ANALYSIS? 1=YES, 0=NO     :    0
SINCE NO VALIDATION IMAGE, LANDUSE CHANGE INFO READ FROM FOLLOWS:
                                  LANDUSE STATE 1       LANDUSE STATE 2
RGNVAL          REGION NAME    # CELLS      BEGIN        END      BEGIN        END
     1             Region 1     294276     152838     140000      78439      91277

# OF TIMES OF OUTPUT BESIDE END TIME    :    0
NAME OF OUTPUT LANDUSE IMAGE            :    delete_testStart Free Trial
[+][-]04.23.2008 at 08:21PM PDT, ID: 21427559

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 08:39PM PDT, ID: 21427621

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 08:51PM PDT, ID: 21427667

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 11:22PM PDT, ID: 21428116

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Script, Python Scripting Language, Windows Batch Scripting
Tags: VBScript, Python, Windows Batch
Sign Up Now!
Solution Provided By: weellio
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.24.2008 at 12:04AM PDT, ID: 21428287

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 05:58AM PDT, ID: 21430267

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 08:09AM PDT, ID: 21431730

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.24.2008 at 09:09AM PDT, ID: 21432428

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 09:11AM PDT, ID: 21432472

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.24.2008 at 10:48AM PDT, ID: 21433357

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.24.2008 at 10:49AM PDT, ID: 21433365

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.24.2008 at 04:17PM PDT, ID: 21435984

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.28.2008 at 10:31AM PDT, ID: 21455864

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628