Need I rewrite whole file if changing an element ?

Post your questions and help other users.

Moderator: Martin

Post Reply
angelatwork
Posts: 186
Joined: 12 Feb 2014 01:45

Need I rewrite whole file if changing an element ?

Post by angelatwork » 02 Sep 2014 09:04

The scenario is this:
i have a written file,
i initiate that file into a variable,
i split the the rows into a list,
I choose a row thru single choice selection menu
split that row variable into a list of its own.
i choose an element, which i change the value of.

To save the change to the written file (csv, txt or whatever) do i have to rewrite the whole file (no means of adding/ removing/ changing a single row or value ("cell")?

Is there a way to script to show all element2 ("column 2") of a file in a single choice menu and by choosing one of the element2s you catch the whole row's values(elements)?
Best regards,
AngelAtwOrk

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Need I rewrite whole file if changing an element ?

Post by Martin » 03 Sep 2014 17:13

Yes, I think you have to rewrite the whole file. When the file is not very large and can be completely read into a variable this process should be quite fast. You can also prepare the complete file in memory and write the file in one go.

angelatwork
Posts: 186
Joined: 12 Feb 2014 01:45

Re: Need I rewrite whole file if changing an element ?

Post by angelatwork » 03 Sep 2014 17:17

thanks for your answer
Best regards,
AngelAtwOrk

Post Reply