Page 1 of 1

Need I rewrite whole file if changing an element ?

Posted: 02 Sep 2014 09:04
by angelatwork
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)?

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

Posted: 03 Sep 2014 17:13
by Martin
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.

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

Posted: 03 Sep 2014 17:17
by angelatwork
thanks for your answer