Using Tasker to search a csv, find return specific info

466 views
Skip to first unread message

Damian Sanford

unread,
Jan 25, 2015, 5:52:44 PM1/25/15
to tas...@googlegroups.com
Hello, 

I'd like to build a scene with Tasker that would allow me to input a value, and return a corresponding number in a window. For example, I would Ideally have a CSV with  containing a vehicle index number and a corresponding mileage. I'd like to enter the vehicle number into the ui on my scene, and have it return the vehicle mileage.

I can make the scene just fine, and I can make the vehicle number a variable "%Vehiclenumber", but how do i get Tasker to find the mileage to go with it on the csv, and post that to another window on my scene (or even just dump into another variable, I can work with it from that point.)


so on my CSV

Vehicle xxx,100,000 mi,10/18/2014,18:30,4448881234


I'd like to enter "Vehicle xxx" 

and I'd like the value returned to be "100,000"

Is this possible?

Thanks for any help,

Damian


Robert Ryan

unread,
Jan 25, 2015, 7:43:37 PM1/25/15
to tas...@googlegroups.com
First note that in a csv file you probably don't want the comma in you mileage number, i.e. 100000 not 100,000.

If the csv file is not huge, one approach would be:

For each record of file
Load record into variable (Read Line)
Split variable into an array (Variable Split)
If array(1) = %vehicle goto End of Loop
Read next record
Show array(2) <---- mileage

Damian Sanford

unread,
Jan 25, 2015, 8:02:38 PM1/25/15
to tas...@googlegroups.com
Haha.. right, no worries, it actually comes through in meters with no commas,  This looks good, I'll give it a try. I'll post the follow up after.


Thanks!

D


--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/nPmktOk2krw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages