Hi Bill, The last variable will be an empty string Check p439 of the customising manual. $string = "first second third" $array = split $string at " " will give $array[1] -> "first" $array[2] -> "second" $array[3] -> "third" $array[4] -> ""
So you could do something like (have not tested this...) $count = 0 count_again: if $array[$count] = "" goto finished_counting $count = $count + 1 goto count_again finished_counting: $last_string = $array[$count-1] ... more stuff Hope this helps. cheers Mike > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Levett, Bill > Sent: Thursday, 1 August 2002 11:54 AM > To: 'ermapper_list' > Subject: Split command in batch scripts > > > Hi, > > Can anyone tell me if it is possible to define the last array > variable then > using the split command. I wish to use the last variable but > I don't know > many variables will result from the split. > > Bill Levett > Geoscience Australia > Scrivener Building, Dunlop Court > Fern Hill Park, Bruce ACT 2617 > Tel: 02 6201 4144 > Fax: 02 6201 4199 > > ----------------------------------------------------------- > > To make changes to your subscription, please visit our > website, http://www.ermapper.com/technicl/ermapperl/index.htm > > > ----------------------------------------------------------- To make changes to your subscription, please visit our website, http://www.ermapper.com/technicl/ermapperl/index.htm
