.csv to listview

I would like to populate the listview I tried with a csv file in the main directory but it doesn't work.
I also wish I could download it from the site but I don't even know where to start.

  1. from a csv file or other type that are positioned in the root of the mobile, load the data in listview
  2. or download the csv from a site, place them in the main directory, load them in the listview

All the examples I have found either upload data to a webviewer or label or are too difficult for me to understand.
amici.csv (11.4 KB)

  1. Your csv file is not valid UTF-8, so it will not work in AI2
  2. You want to save the csv file in the root of the mobile - this is no longer possible, the easiest location is in your application specific directory (ASD) which has a file path:
/storage/emulated/0/Android/data/<your package name>/files/...
  1. You can easily download file using the web component

Where do you want to start ?

In the meantime, I apologize, I had forgotten the magic word (Please).
Good question, where is it easier from.
I would need both and I would like to understand how I can turn it into a UTF-8 file
But any example that doesn't take up too much time will do.

It looks like you are generating the file from Excel on Windows.
Open the file with notepad, and save as UTF-8 encoded
(I believe this is correct, don't go near Windows)

Ok I try thanks

Great it works! Now how do I get rid of the brackets in the listview?

You can either use replacement blocks, or set each item in each inner list to a string, in a new list

Ok I understand I have to get by on my own, I'll search the net, because what you explained to me is Arabic.

Thank you, for the help you have given me so far, you have already been too kind.
I know that you always try to make people learn how to proceed, but I have a hard time remembering, as I have already written (otherwise I would be a billionaire and already an appinventor scientist), but unfortunately every time I create an App I have to go and search the others the blocks, starting them all, even for the simplest operations and sometimes I am forced to run for hours on the net to find blocks of code that I had already created for some time but that I did not remember.
Have a good evening.
Also not understanding English limits me a lot, I often go by intuition.
Have a good evening

Probably the best thing to do:


When you take action after a selection from the listview, use the selectionIndex to refer back to the original list

Good day, in order not to disturb anyone, I have still been online a lot, because the solution you proposed eliminates all the records in the table instead of just eliminating the brackets.
But I didn't find anything that clarified the problem for me.
Where am I wrong? As you can see I followed your blocks and also modified in the second case, but they don't work

In your test aia there is no file named nomi.csv

Angelo, hai inserito nel tuo progetto un file excel, non un file di testo, inoltre nel file xlsx tutti i dati iniziano con uno spazio e finiscono con la virgola e questo รจ sbagliato, correggi e poi salva come csv.

Thank you for the help, but I created the file first from a text file and saved it in csv (UTF-8)
Then the file is loaded normally from the root directory in listview but with the brackets to the right and left of the names)
I also tried to create the file in Google Site as from some examples in Youtube to lro it works but it doesn't work for me and yet I followed their every indication as in these images that I posted.

Button1=file readfrom

Did I post the wrong .aia file to you? I reload it.
Nomi.csv (40 Bytes)

Where is this nomi.csv ? Saved in your phone ? because see ...


Otherwise simply upload your csv here. In case you are not allowed to upload a csv, simply rename it to .txt

That file is part of my first experiment, I forgot to delete it.
As I wrote, the file is an actual csv, which I posted to you, but the problem here is not the file, because the file as I wrote is loaded normally, but with brackets in each name, so how do I delete them? I have followed many examples but they do not work with me. What's wrong with the blocks, which ones are the right ones? o HOW I have to modify them.
If you tell me that the error is in the file, do not spare as another create a .csv file.

I deleted that excel file, but again, it was part of my first experiment, to see if it loaded files larger than 5 or 6 names.
I am sending you the threshing floor again

As you can see the file is placed in the default directory in android, and everything goes well, the file is loaded, but I can't remove the brackets.

Your nomi.csv contains only one column.

csv_2a.aia (12.6 KB)