V
Valiceemo
Guest
*
I have a text file created by another task.*
Within this task I have an action to give me a list of all the first words on each line. I then use a variable split to give me the array. But its at this point I get stuck. I want to be able to create new variables based on the array. Noting that the text file may well change from day to day (No. of lines)
List (111)
********A1: Run Shell [ Command:cut -d "/" -f 1 sdcard/documents/stuff/file.txt Timeout (Seconds):0 Use Root:On Store Output In:%entries Store Errors In:%err Store Result In:%res Continue Task After Error:On ]*
********A2: Variable Split [ Name:%entries Splitter: Delete Base:Off ]*
********A3: [X] Variable Set [ Name:%totalentries To:%entries(#) Do Maths:Off Append:Off ]*
********A4: For [ Variable:%entry Items:%entries() ]*
********A5: Variable Set [ Name:%entry1 To:%entry Do Maths:Off Append:Off ]*
********A6: Flash [ Text:%entry1 Long:Off ]
So above you can see where I'm going. Its the array %entries that I want to use to create completely be variables. So %entries(#) = 2, %entries1 = car, %entries2 = bike.*
I want to create new variables.*
%newvar1 = car
%newvar2 = bike
But the array %entries() will change.*
If you follow that!?
I have a text file created by another task.*
Within this task I have an action to give me a list of all the first words on each line. I then use a variable split to give me the array. But its at this point I get stuck. I want to be able to create new variables based on the array. Noting that the text file may well change from day to day (No. of lines)
List (111)
********A1: Run Shell [ Command:cut -d "/" -f 1 sdcard/documents/stuff/file.txt Timeout (Seconds):0 Use Root:On Store Output In:%entries Store Errors In:%err Store Result In:%res Continue Task After Error:On ]*
********A2: Variable Split [ Name:%entries Splitter: Delete Base:Off ]*
********A3: [X] Variable Set [ Name:%totalentries To:%entries(#) Do Maths:Off Append:Off ]*
********A4: For [ Variable:%entry Items:%entries() ]*
********A5: Variable Set [ Name:%entry1 To:%entry Do Maths:Off Append:Off ]*
********A6: Flash [ Text:%entry1 Long:Off ]
So above you can see where I'm going. Its the array %entries that I want to use to create completely be variables. So %entries(#) = 2, %entries1 = car, %entries2 = bike.*
I want to create new variables.*
%newvar1 = car
%newvar2 = bike
But the array %entries() will change.*
If you follow that!?