Advertisement

07.13.2008 at 10:27PM PDT, ID: 23561753
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.5

VB Script - Copy text to new files with additional text insertion.

Asked by mgjust in VB Script

Hello,
I asked this question before:
http://www.experts-exchange.com//Q_23349033.html
and now I can't seem to get the VBScript to work.  Where does the script look for the excel file to get the values for line 41? Does it print them one line at a time for each new .gmd output file?

Thanks,
MJStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
Sub makinfiles
        DIM fso, myFile, x
        Dim begin1, begin2, end1, end2, num_cells
        Set fso = CreateObject("Scripting.FileSystemObject")
        myrow = 1 'starting row
        strfolder = "c:\scripts\ccc\"           'folder where you want the files (make sure it exists)
        for x = 75 to 407
                mynumber = x
                
                begin1          = Range("A" & myrow).value
                begin2          = Range("B" & myrow).value
                end1            = Range("C" & myrow).value
                end2            = Range("D" & myrow).value
                num_cells       = Range("E" & myrow).value    'not sure what you want for this
                
                if mynumber < 100 then mynumber = "0" & mynumber
                Set myFile = fso.CreateTextFile(strfolder & mynumber & ".gmd", True)
                myFile.WriteLine("***************************************************************")
                myFile.WriteLine("* THIS FILE CONTAINS THE VALUES OF THE PARAMETERS REQUIRED    *")
                myFile.WriteLine("* FOR THE GEOMOD MODULE, WHICH AUTOMATICALLY IS GENERATED IN  *")
                myFile.WriteLine("* IDRISI. STRONGLY RECOMMEND REEDITING IN IDRISI IF NECESSARY.*")
                myFile.WriteLine("***************************************************************")
                myFile.WriteLine("")
                myFile.WriteLine("TIME TO BEGIN GEOMOD, INCLUSIVE         :    2001")
                myFile.WriteLine("TIME TO END GEOMOD, INCLUSIVE           :    2016")
                myFile.WriteLine("TIME STEP IN TIME UNITS                 :    1")
                myFile.WriteLine("")
                myFile.WriteLine("# NEIGHBORS AWAY TO SEARCH,0=NO NIBBLE  :    1")
                myFile.WriteLine("WRITE DEBUG OUTPUT TO LOG FILE,YES=1    :    0")
                myFile.WriteLine("NAME OF STRATA/MASK IMAGE               :    N/A")
                myFile.WriteLine("NAME OF INITIAL LANDUSE IMAGE           :    gr_lc_01b_" & mynumber & "_fp")
                myFile.WriteLine("DO ENVIR. IMPACT ANALYSIS? 1=YES, 0=NO  :    0")
                myFile.WriteLine("CMP/READ SUITABILITY SCORES(0=CP,1=RD)  :    1")
                myFile.WriteLine("NUMBER OF RUNS ONCE                     :    1")
                myFile.WriteLine("SUITABILITY IMAGE FOR SIMULATION 1      :    c2_mce_" & mynumber)
                myFile.WriteLine("DO VALIDATION ANALYSIS? 1=YES, 0=NO     :    0")
                myFile.WriteLine("SINCE NO VALIDATION IMAGE, LANDUSE CHANGE INFO READ FROM FOLLOWS:")
                myFile.WriteLine("LANDUSE STATE 1       LANDUSE STATE 2")
                myFile.WriteLine("RGNVAL" & vbtab & "REGION NAME" & vbtab & "# CELLS" & vbtab & "BEGIN" & vbtab & "END" & vbtab & "BEGIN" & vbtab & "END")
                myFile.WriteLine("  1   " & vbtab & "Region 1" & vbtab & num_cells & _
                                                                                                        vbtab & begin1 & _
                                                                                                        vbtab & end1 & _
                                                                                                        vbtab & begin2 & _
                                                                                                        vbtab & end2 & "")
                myFile.WriteLine("")
                myFile.WriteLine("# OF TIMES OF OUTPUT BESIDE END TIME    :    0")
                myFile.WriteLine("NAME OF OUTPUT LANDUSE IMAGE            :    delete_test")
                
                myFile.Close
                myrow = myrow + 1
        next 
end sub
[+][-]07.14.2008 at 06:10AM PDT, ID: 21997693

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 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 07:18AM PDT, ID: 21998268

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

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

 
[+][-]07.14.2008 at 07:21AM PDT, ID: 21998303

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 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 08:45AM PDT, ID: 21999143

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 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 08:52AM PDT, ID: 21999202

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

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

 
[+][-]07.14.2008 at 09:11AM PDT, ID: 21999407

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 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 03:04PM PDT, ID: 22002537

View this solution now by starting your 14-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

Zone: VB Script
Sign Up Now!
Solution Provided By: weellio
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.17.2008 at 01:12PM PDT, ID: 22029732

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 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628