# Save list as csv and load it back

**URL:** <https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753>\
**Category:** Getting Started\
**Created:** [October 19, 2019, 4:39am UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753 "2019-10-19T04:39:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincenzo\_Luciano](https://forum.xojo.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@Vincenzo\_Luciano](https://forum.xojo.com/u/Vincenzo_Luciano)\
**Post date:** [October 19, 2019, 4:39am UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/1 "2019-10-19T04:39:05Z")

</div>

Hallo Xojo community,

I’m a new member. I beginn to learn with the ToDo listbox tutorial. At the end I added a “SAVE” button but don’t have any knowledge to write the appropriate code to save the ToDo list, for example as csv-file, in a manner that I can later load the file, to add further tasks and save it one more time.

cheers  
Vincenzo Luciano

---

<div class="post-metadata">

**Author:** ![Rolf\_Genster](https://forum.xojo.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@Rolf\_Genster](https://forum.xojo.com/u/Rolf_Genster)\
**Post date:** [October 19, 2019, 7:57am UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/2 "2019-10-19T07:57:02Z")

</div>

Hello Vincenzo,  
please take a look at these topics in the Xojo-Documentation(-\>Help -\>Language Reference or F1 within Xojo):  
textoutputstream  
textinputstream  
Everything you need is described there with examplecode (for listbox data there is a example at textinputstream) to start with.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [October 19, 2019, 8:34am UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/3 "2019-10-19T08:34:42Z")

</div>

> [@459204:@Vincenzo Luciano](#):
>
> ToDo listbox tutorial

Desktop, Web, List, iOS ?

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [October 19, 2019, 8:53am UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/4 "2019-10-19T08:53:53Z")

</div>

Compare the code below \* to the TextInputStream example I took it from:

` Dim t As TextOutputStream
  Dim f As FolderItem
  f = GetSaveFolderItem("", "Save_As_Example.csv")
  If f <> Nil Then
    t = TextOutputStream.Create(f)
    t.WriteLine(LB.Cell(-1,-1))
    t.Close
  End If`

Nota: the code above do not makes reliable backup file (in one test, it store everything from a certain Row until the end of the Listbox into only one Row instead of 20/280 Rows.

But this is an example.

Nota:  
LB is the reference of the ListBox.  
The Column delimiter is the default value: a Tab.  
If you want another delimiter, change it before saving it to disk.Same apply of you want to put all Cells contents between quotes.

And so on.

Load LibreOffice, create a Calc File, populate it and try to export it to csv to know how “the industry” proposes. 😉

Now you have an example to works from (simplistic).

Did I told you that examples of csv files and question about csv exists in this forum ?

BTW: I took the example from the API 1 LR. Changes may happens with API 2.

---

<div class="post-metadata">

**Author:** ![Vincenzo\_Luciano](https://forum.xojo.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@Vincenzo\_Luciano](https://forum.xojo.com/u/Vincenzo_Luciano)\
**Post date:** [October 19, 2019, 10:21am UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/5 "2019-10-19T10:21:07Z")

</div>

Hallo Rolf, Danke.  
Bonjour Emily, Merci.

I will try my best and post a feedback.

---

<div class="post-metadata">

**Author:** ![Vincenzo\_Luciano](https://forum.xojo.com/letter_avatar_proxy/v4/letter/v/a698b9/32.png) [@Vincenzo\_Luciano](https://forum.xojo.com/u/Vincenzo_Luciano)\
**Post date:** [October 19, 2019, 1:50pm UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/6 "2019-10-19T13:50:22Z")

</div>

Pardon Emile, i wrote wrong your Name.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [October 19, 2019, 2:36pm UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/7 "2019-10-19T14:36:57Z")

</div>

Hi Vincenzo,

This happens to me so often on those last years that I do not notice it ! 😉

Dont worry.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:08pm UTC](https://forum.xojo.com/t/save-list-as-csv-and-load-it-back/50753/8 "2021-04-29T16:08:03Z")

</div>


