Ivan1
December 5, 2023, 12:38am
1
Hi, I want to update the value of the contents of the text file by adding integer one to the value after ',' for a specific row.
This is our progress as of now.
This is the content of trendsList.txt:
Expected Output (for example, first row is selected):
Actual Output:
Please I need assistance. Thanks in advance.
1 Like
John3
December 5, 2023, 1:38am
2
same problem i am experiencing
your content of the text file is a csv table.
You can use to change the content to a list of list, then iterate the list to modify any item.
Then convert this list back to csv table, then save to file.
Ivan1
December 5, 2023, 2:30am
4
Hi, do you have a sample on how to implement this?
Peter
December 5, 2023, 6:04am
6
Since you have the same ip address as @Ivan1 that is not surprising.
1 Like
ABG
December 5, 2023, 4:07pm
8
Packing up your table back into a file after updating it is like living out of a suitcase.
If you are going to keep on updating counts, consider keeping the data in TinyDB, with tag = drug name and value = count.
Convert it to a file only when you need to export it.