Hi, I have the start of an app that enables me to scan a QR Code and store the data in a list, then export to local storage on Android as a CSV file.
The issue I'm having, is that each line in the list that is exported into the CSV, starts and ends with " (inverted commas) which prevents the data from appearing in columns.
Is there a way I can get the data to export without the "?
I can't get a Do It result to show anything. I click Do It on the Export Blocks and the file is created on my phone but no data is shown on the PC screen
You are using two different tags to store your data:
an empty text (is this even legal?)
the fixed text value ',First Name,Last Name,Division' (That leading comma os probably trouble.)
You get from the blank tag, add new items to it, then store to the second tag.
So you lose whatever you had added on a previous run.
Then you loop through all the tags, assming each associated is a list with 1 item, to build an export text.
You write the text to a file, then try to read it back before it has finished the write operation. (look through the File events. They are there for a reason.)
I can't vouch for the /Download/ location. I prefer to use the share component for my exports.
Hi ABG,
Thank for the reply. That preceeding , has been removed. It was only there to see if it made a difference when opening the CSV file with Google Sheets (but it didn't).
The fixed text vale 'First Name,Last Name,Division' is there in the hope of adding Headers to the CSV file, which are required by the App I'm going to need to import the CSV into after all the works correctly.
The share component might be a better option in the long run, but I'm not sure the App I'll need to import to will support that.
Just trying to get a working CSV file before anything.
Thanks
avoided tag typos by using a constant global variable
delayed announcing file write success until its completion event
removed the read back code. It would have never worked in its location, and you've got TinyDB anyway.
used Create Empty List as the TinyDB Not Found default for the list of scans, avoiding poisoning of list operations with text blank where expecting a list.
ABG Thank you. That fixes the issue and the CSV file is created and recognised properly. Thank you!
I'm going to compare the 2 aia files to try and get my head around the difference. Where was I tripping myself up with the tags? I'm sure I'll see when I compare.