Re: Handling external text files.

99 views
Skip to first unread message

Cptnodegard

unread,
May 13, 2013, 2:15:57 AM5/13/13
to tas...@googlegroups.com
All possible, but it requires that you know how to handle variables and related actions properly. Maybe someone here is willing to give you a step by step guide, otherwise I just suggest you dive into that aspect of Tasker and learn from scratch

Fer Nando

unread,
May 13, 2013, 4:42:02 PM5/13/13
to tas...@googlegroups.com
Sorry, I'm afraid I send you a personal email despite answering in the group...

As I said, I'm more or less comfortable with variables, shouldn't be a problem for me if properly oriented... I don't think I need a step by step guide.

I've thought on a workaround with a file that already have a file count: copy the file to a variable, delete the file and recreate the file with the same name copying all but the last line... I don't think it's very efficient... As I said, would be useful for me to be able to know the number of lines in a file.
I think I could go to the rest with that.


Thanks again.

easiuser

unread,
May 13, 2013, 5:23:28 PM5/13/13
to tas...@googlegroups.com
All you should have to do is create an index variable, use the Read Line action for each file, compare the two variables and use Write File with append on to create the output file, increment the index and repeat.  When you read in EOF, your at the end and the index variable will contain the number of lines +1.

If all you want is the count, you could read the file into a variable (say %fileinput), split the variable with a newline variable and then you can get the count as %fileinput(#)

Can't say that either method mentioned is efficient.  Sounds like an application you may want to do with a script.  Can't help you there.

Fer Nando

unread,
May 14, 2013, 5:38:46 AM5/14/13
to tas...@googlegroups.com
You helped me a lot. :)

Thank you very much!
Reply all
Reply to author
Forward
0 new messages