viewpoint-particle

Author Topic: Parsedata  (Read 616 times)

Secondlaw

  • Newbie
  • *
  • Posts: 15
Parsedata
« on: January 02, 2018, 11:22:17 am »
Been a while since I've used Winbatch but I've been requested to create a fairly simple script but I'm stuck at one part.

Essentially, I'm parsing a string.  "param0" is the number of values.  I'm attempting to use each value in a "for/while" sequence.

I figured if I used this simple code, I could pass a "COUNT" variable to the the end of each PARAM.
Example:

Whereas the values for all Param variables would be filenames:

count=1
for x=count to Param0
 Filename=strcat("param",count)
 COpy (filename to "patyhto\xyz.txt")
next

I know this isn't the exact code.  I can't seem to work it out where "Param",count would be "param1" and substitued with the filename then move to PARAM2 and a new filename, until it reaches the value in PARAM0.

What am I doing wrong.

 Thanks


stanl

  • Pundit
  • *****
  • Posts: 808
Re: Parsedata
« Reply #1 on: January 02, 2018, 11:45:00 am »
Assuming param is a variable

Filename=strcat("param",count)

should be either  Filename=strcat(param,count)   or Filename=strcat("%param%",count)

Secondlaw

  • Newbie
  • *
  • Posts: 15
Re: Parsedata
« Reply #2 on: January 02, 2018, 11:53:44 am »
Assuming param is a variable

Filename=strcat("param",count)

should be either  Filename=strcat(param,count)   or Filename=strcat("%param%",count)

"param" is not an output variable from parsedata.   The way mine is setup (although it doesn't work), takes this into consideration.  The output from my filename line would be, "PARAM1" then "PARAM2" so on and so fourth.  This portion works but I need to associate "PARAM1", "PARAM2" etc... with the actual Parsedata values which would essentially be file names.

Secondlaw

  • Newbie
  • *
  • Posts: 15
Re: Parsedata
« Reply #3 on: January 02, 2018, 12:01:31 pm »
I think I've figured it out.  I have to use ItemExtract.  :)