1) Read .csv file from phone, 2) Seach for a keyword 'Apple4321' 3) If keyword found, then look for the nearest word if it is 'send' 4) If the word 'send' is found do some action like 'play music'

I guess, this block may help.

text_replace_all

It is a bad design choice to use a file as data storage if you have to edit data frequently, because it is cumbersome to work with files

You have to read it completely, edit what you want to edit and save it again...

The question is, why don't you use a database? Depending on the requirements this can be a local sqlite database or if several people need to access it a server database

Taifun

1 Like

I am looking for the option that is free of cost forever. I was planning to use Google Sheet, but after I learned that it is not free after certain quota limit, I decided this.

I think, Sqlite database is also not free of cost forever.

But, if I choose .csv file to achieve this, I can make it totally for free of cost forever. So, I can offer apps for totally free of cost to people and play google ad in it. When I get revenue from ads, According to the revenue value, I will use the databases like sqlite or google sheet later.

For safety at beginning, I prefer to use .csv file. I think that the automation app 'Tasker' can save the file frequently whenever there is any update in it. I have to check it, not sure now.

1 Like

TANSTAAFL

let us know what you found out and provide a link to these Google sheet quota limits

you are wrong

Taifun

1 Like

Remember, you have to use SAF to read/write non media files your app does not own, see also Some basics on Android storage system

Also you might want to think about how you plan to solve the problem of 2 processes (Tasker and your app) writing at the same time

Taifun

1 Like

I Did something similar cvs file sent to GSS and deleted after being sent. Then a new file with same name sent again and appended to the GSS. But blocks where lost, after my son was intubated due to covid, but i Will recode.....i Will see if i can find my way back. I Will let you know if i can re do it.

1 Like

I managed to update .csv file using Tasker in phone (for every email notification from a specific sender), Next thing is to update that same .csv file in a different way using mitai2. In this way, I think I can skip using google sheet or other databases frequently and avoid quota limit issues.

But, since sqlite is free of cost, Il use that as well in part of the app needs.

NOTE: I used Tasker (One time payment around 3 usd), Autonotification plugin (free of cost if we watch a reward ad occasionally) and fairemail (free) for watching email notifications.

Can I use Taifuns Notification listener extension to cancel the notifications one after other?

No
You could have read rhe documentation to answer this question yourself

Taifun

1 Like

I read it once but asked to know if there is any possibility. Thankyou

3 posts were split to a new topic: Trying to adjust an old project

You could try the CloudDB, Is that what you need?
CloudDB is ai2's database in the cloud that is not stored on just one instance of the app, it is stored on everyone's instance.
If that is not what you want and you want a local database that is different for everyone's device, try TinyDB.
all of these use a key/value thing.

After spending lot of time, yesterday I completed the coding part of Tasker. Now, Tasker will do the following always.

  1. If email notification recieved with keyword that start with prefix key in FAIR EMAIL, Tasker will parse complete notification and store it in text file.

  2. I already have .CSV file with lot of keywords and onesignal id in the next column of it. If the keywords from notification is matched with CSV file, then Tasker will provide the row number where the keyword recived in notification is matched. This row number/index will be stored in another text file.

  3. Now in mit ai2, il create an app that will parse the row/index value from that text file and collect the required data from CSV file( ie, onesignal id belongs to that row) using the row/index number.

  4. This collected onesignal id will be put in a gloabal variable and a message will be triggered 'You Got A New Order'. So, the right user will get this notification.

CODE THAT I CREATED IN TASKER:

Task: Temp
Settings: Run Both Together

A1: AutoNotification Query [
     Configuration: Persistency Type: Both
     Notification Apps: FairEmail
     Get All Fields : true
     Timeout (Seconds): 20
     Structure Output (JSON, etc): On ]

A2: Write File [
     File: Download/CSV File Viewer/hi.txt
     Text: %antextbig()
     Add Newline: On ]

A3: AutoNotification Cancel [
     Configuration: Id: %anid
     Notification Apps: FairEmail
     Package Name: %anpackage
     Timeout (Seconds): 20
     Structure Output (JSON, etc): On ]

A4: Read File [
     File: Download/CSV File Viewer/hi.txt
     To Var: %textfile
     Structure Output (JSON, etc): On ]

A5: Variable Search Replace [
     Variable: %textfile
     Search: \bkey\w*\b
     Store Matches In Array: %textkeys ]

A6: Write File [
     File: Download/CSV File Viewer/antextbig an.txt
     Text: %textkeys()
     Add Newline: On ]

A7: Read File [
     File: Download/CSV File Viewer/antextbig an.txt
     To Var: %textfilewithkeys
     Structure Output (JSON, etc): On ]

A8: Variable Set [
     Name: %newline
     To: 
     
     Structure Output (JSON, etc): On ]

A9: Variable Set [
     Name: %newspace
     To:  
     Structure Output (JSON, etc): On ]

A10: Variable Search Replace [
      Variable: %textfilewithkeys
      Search: ,
      Replace Matches: On
      Replace With: %newspace ]

A11: Variable Search Replace [
      Variable: %textfilewithkeys
      Search:  
      Replace Matches: On
      Replace With: %newline ]

A12: Variable Set [
      Name: %text_data
      To: %textfilewithkeys
      Structure Output (JSON, etc): On ]

A13: Variable Split [
      Name: %text_data
      Splitter: %newline ]

A14: Read File [
      File: Download/CSV File Viewer/2010.csv
      To Var: %csv_data
      Structure Output (JSON, etc): On ]

A15: Variable Set [
      Name: %to_search
      To: %text_data(+/)
      Structure Output (JSON, etc): On ]

A16: Stop [ ]
    If  [ %csv_data.Header3(#?%to_search) eq 0 ]

A17: Array Set [
      Variable Array: %indexes_of_matches
      Values: %csv_data.Header3(#?%to_search)
      Splitter: , ]

A18: Flash [
      Text: %indexes_of_matches()
      Continue Task Immediately: On
      Dismiss On Click: On ]

A19: Variable Search Replace [
      Variable: %csv_data
      Search: \Q%csv_data.Header1(%first_match),%csv_data.Header2(%first_match),%csv_data.Header3(%first_match)\E
      Replace Matches: On
      Replace With: $0,find ]

A20: Write File [
      File: Download/CSV File Viewer/hihi.txt
      Text: %indexes_of_matches()
      Add Newline: On ]

A21: Text/Image Dialog [
      Title: Result
      Text: %csv_data
      Button 1: Ok
      Close After (Seconds): 120 ]

You could have done this with the notification listener extension together with itoo and avoid using csv files

I already explained earlier, that using files is a bad solution

Taifun

1 Like

Even though, using files may not be a good choice, I wish to proceed in this way for-now. After completing this, I will move from files to sqlite in future. Is it necessary to use SAF if i use download folder?

My Text file will be updated regularly (maybe always) with numeric values (row number/index) like 4,7,1,8,4,9,2,5, etc.

How can I parse these data (may be using MFile or alternatively)?

Here is my suggestion without Tasker and without using csv files
.

Use the notification listener extension together with itoo to parse the notification

You have that information stored inside your app or Google Spreadsheet and do the necessary processing inside your app

Taifun

1 Like

:slight_smile: Let me strive to know the possibility. :slight_smile:

Since my text file has data 1,3,2. i can read it and store it in a variable but how can I pick each value one after other? I know it is possible to do, but I don't know how to do it.