Save and retrieve datas to and from a CSV file

I have read this tutoriall and have pretty much done what it suggests. However, I am reading 4 lines of csv string, value pairs without and quotes into a list and in the app making updates to the values. Converting the csv into a list on reading the file "list from csv table text" I am then writing the file back with "list to csv table list"

When I re-read the file at startup each item in the "string" , "value" pairs have quotes making the values into strings and unusable.

The only difference in my version is I use "list from csv table text" in passing the data directly into file save from the list variable

Any clues please.

AppInventor handles numbers in strings as numbers, so you should have no issue with that.

If you need to supply an integer to your bluetooth connection, then remove the quotes by multiplying by 1.

Consider using the Web component for JSON conversion, both ways.

JSON is better than CSV for preservation of type and structure.

There is also YAML, but you would have to roll your own.

Thanks; it was the Bluetooth address that had the issue with the quotes it needs the hex pairs separated by ":" (no quotes). Then the preset buttons ended up with the values in quotes and couldn't be used.

I guess the x1 trick is to convert a value strings into a numeric but it wouldn't work with the BT address. Then I did use segment text to get rid of them, but that fell over when the quotes weren't there

strip quotes blocks

I guess I'll have to compromise and fudge the original config file with quotes, multiply the values by 1 and do the strip on the BT address.

Or

Thanks again

You can also use the replacement block to remove quotes from strings:

image

That's way better thanks as on the first pass there aren't any quotes.

I was going to use it to strip the quotes from the BT address. But stripping all the quotes on the file write back means the "var x1" trick isn't required either.

Thanks again