Unable to remove item from list

When is it necessary or preferable? So why have it?

When you already have a list in a variable, and you want to make a copy of that list. If you just set it to another variable it will be the same list with two different names. In your situation, you need to set the "text" from the Web.GotText to a list, then a variable, to be able to work with it as a list. The original data will remain unchanged.

Well, I can't get it to work.
Could someone please show the blocks necessary to:
import a ,csv table in .txt format from phone sd card into a list and then remove any entry from said list.
Thanks very much.

Do you have an example file (csv/txt) - a physical file (or url) - best if we use your data, then we can handle any specific issues it may have ?

Also advise how you are reading in the csv/txt file - with the file component or with the web component....

I use the file component and the data data is then stored in / retrieved from TinyDB.
How do I send you a file?

You can just upload it here

image

lstBuy.txtlstBuy.txt (56 Bytes)

That is quite a different list to the one you show further up in the topic.....

oil,89,Big Market,16/07/2020
sandwich bread,336,Shopping Center,17/07/2020
mortadella,284,La Brocceta,17/07/2020

OK, but I have the same problem.
Here's the file for the blocks lstArchive.txt (2.2 KB)

Nothing special or different about your txt file :slight_smile:

Here is an aia project that removes the last item from the list, showing the base content of the file, the content when converted to a list, the item to be removed, and the list after the item has been removed.

removeItemFromListFile.aia (3.5 KB)

Only a minor change to the blocks ("list from csv row" instead of "from table") for your other list (lstBuy)

image

To remove "any item" from the list, use a listview to select:

image

OooooooK... but why list from csv when the data is actually a table (in the case of lstArchive)?
Should I use list from csv row in the pamFilesDist block?

...and here?
image

The data from the file (text) is raw csv data. In order for AI2 to work with this data as a list, it must be converted to a list using the list from csv table (for lstArchive which is a list of lists or 2D array) or list from csv row (for lstBuy which is a list or 1D array) blocks.

I see in your blocks that you have determined to not convert the text data to a list - if you want to work with the data as a list you will have to convert at some point...It is probably best to do this conversion up front, save it to a variable, then save that variable into your tinydb.

Okey dokey. I'll give it all a whirl and let you know.

Thanks very much for your time

Greetings,

The block works for both 1D and 2D arrays... thanks very much.

Just one more little thing: the way the data is presented in Label1 (RawData) is the way I want the data to be presennted after the deletion of a field/register. How do I do that? Is there a preset Change Format option or do I have to use Text handling blocks?

Thanks a lot

Have a good one.

Of course there is... list to table... sorry