Even the title was hard to write !
I will try to give a better explanation.
I have a SQLite Data Base that I export as Text (in a TEXT file).
Four years after the initial shipment, the Client asked to be able to put ore than one line of information in some Fields (Columns). Ive done that. In the Listbox display, only part of the data is displayed usually the first line) and we do not care (the Client and me). I provide a Record view (in a brand new Window).
Testing is not what they know how to ! So, they do not tested the application on Export to text / Import from Text.
While I was working on a different project (not so different; a different project file
), I was displaying data from different file types: csv, json, text, xml
I skipped json and do TEXT minutes ago. I do not recall how I’ve got that way, but the so called different project leads me to think at a problem in the other project where I store three lines in the same Cell
I resolved this problem with a CSV file month ago (with help from this forum). But how can I resolve this problem using TEXT files ?
After a 25 minutes walk, I found a (bad ?) solution: what if - at export time - i replace the Return(s) with Enter(s) and do the reverse at read time ?
Con: what a strange idea.
Any other idea ?
use a chr(1) for field separator, and chr(2) for record separator, use the same for importing.
they won’t appear in the text fields.
did this looooooong time ago with 4th dimension text fields that accepted CR with no reserve …
The trouble may comes (if one happens) when the TEXT file is read in a different application.
Your experience ?
CSV is a well-known format, which can be read and written my many applications. The same is true for html, json and even SQL. As usual you need to define better what you want to do and you have to describe what your problems actually are.
The question is about TEXT file (extension txt), import / export nothing else.
Question: How do I store in a TEXT file a list of text values where some “fields” can hold one or many Return (lines) ?
I already know how to deal with multiple lines in Cells with CSV *, thanks to this list. SQLite: nothing special to do excepted for the display part.
The same is true for html
Is html a format to use for Import / Export ?
If your time is so limited that you cannot read the whole text, skip the question as I do for some conversations.
Also, I noticed recently that sometimes the answers to original questions are
not in tune with the question. It even came to me to not give answer because I do not understand why the first (or two first) answer(s) fall into that case to discover more answers later that they all were responding to a different question.
The answer I gave to a Beatrix question lately fall into this category: the first answer was not in tune with the question (IMHO), so I do not send the correct answer until I realized it really was the right answer. Sorry for the delay.
If a correct answer seems to be ignored by the op, it may be because the op do not realize (understand) that this was the correct answer. Remember the 80/20 rule; 80% of the people will understand one answer (explanation) while the remaining 20% needs a differently constructed sentence to understand it.
Import / Export
You may think your application is able to Export YOUR data to be read with a different application (or a backup in a different format)
Same for Import: your application allows the import of structured data that comes from elsewhere (client, prospect, internet, etc.).