Tasker variable limits

179 views
Skip to first unread message

Matti Zinn

unread,
Feb 13, 2015, 7:07:23 AM2/13/15
to tas...@googlegroups.com
Hi guys,

I've been slowly building a .csv reader with Tasker. I realised from the get-go that Tasker is not meant for such uses but I didn't realise it is THAT bad at dealing with large amounts of data. I have a .csv file with 6 cols and 255 rows (1530 points - I don't consider this to be large!) and it's taken Tasker 30secs to read it. 

Is this just my phone or does Tasker just not deal with volume data? I'm not using any global vars in the task.

If this is a Tasker issue then where can I find info about the "limits"? Anything that can be done to make it quicker?

Thanks!

Pent

unread,
Feb 13, 2015, 9:54:11 AM2/13/15
to tas...@googlegroups.com

If this is a Tasker issue then where can I find info about the "limits"?

There is no limit with your task. It took 30 seconds, that makes it slow, not limited.
 
Anything that can be done to make it quicker?

We don't know how you did it, how can we offer improvements ?

For instance, slurping up the whole file in one go then working on it with e.g. Variable Search Replace may
be faster. But not if your're doing that already, obviously.

Pent

Matti Zinn

unread,
Feb 14, 2015, 4:00:48 AM2/14/15
to tas...@googlegroups.com
Fair enough!

The goal at the moment is to read a .csv and split it into variables containing the column items. e.g., a .csv which has items:
1,a,!
2,b,@
3,c,#
would output variables in the form %column1 = 1,2,3 %column2 = a,b,c %column 3 = !,@,#. I also account for some items being empty. So a file containing:
1,,!
2,
3,b 
would output %column1 = 1,2,3 %column2 = ,,b and %column3 = !,,

So now how did I do it? Basically:
  1. Read file in variable %fileinfo
  2. Split variable %fileinfo. no splitter. This seems to split it based on newlines
  3. Set variable %lengthoflongestline (to be used find how many items should be in line to the number of columns can be set)
  4. Loop through each of the array %fileinfo 
    1. Split each item based on comma
    2. count how many items in the new array
    3. Compare to %lengthofnewline and renew %lengthofnewline if the count is larger
  5. Now that I have the number of columns required I loop through each item in %fileinfo()
    1. Split based on ,
    2. Loop through each item in the new array
      1. store each existing item into %columnX etc. where X is set by a counter running through the loop to determine which column we are at (using array push)
      2. if the number of items is less than %lengthoflongestline then I fill the rest of the spaces with ' '
Thats the basic idea. Thought its easier than writing each Tasker task.

Thanks!
Reply all
Reply to author
Forward
0 new messages