Deleting a line in a csv file


#1

Hello, how to remove a line from a CSV file from its number, (that is, type the number in a text box and then click a button)


#2

Use the “index” number with the remove item from list block.


#3

Can you give me the block please


#4

you might want to try something yourself, see also tip 2 here https://puravidaapps.com/learn.php
and if you get stuck, then it would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.


#5

In addition to what @Taifun mentioned, look into list from csv table block


#6

Here are the screenshots

CSVBLOCK


#7

read the csv file using the file component, convert it into a list using the list from csv table block and then use the remove item from list block together with the index, which will be entered in your textbox

following this description you now should be able to try something using blocks and if you get stuck, post a screenshot of your relevant blocks

Taifun


#8

it might be easier for you to store your data in a list of lists rather than using a file…

How to work with Lists by Saj
How to work with Lists and Lists of lists (pdf) by appinventor.org
Taifun


#9

For data stored in csv, without update the whole csv, any syntax to enter into csv file, remove a row of data and insert a new row of data into the desire row?


#10

you only can read or write a complete file…
you might want to keep your data in a list or list of lists and use TinyDB to store the list…
another solution is to use the local sqlite database…

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.