What is the ListBox “Native” format ?

What is the ListBox “Native” format ?

This is a question that comes to mind while I was writing an explanation about csv and txt files in File I/O operations with Xojo (in fact with my application).

I used the terms “Native Format” to define a line using the tab character as the field delimiter.

Then, I activate he “Get An Eye” - on a Finder file - function. I selected a txt file (saved with a tab as the field delimiter), then a true .csv file, then replace the .txt file extension of the tab delimiter file to .csv and noticed a real difference:

the true .csv file display the text data in a grid (à la ListBox)
the .txt, tab delimiter file displays the text data in a a surrounded rectangle, add a line to separate all Rows, but no vertical column align line was displayed.

Obviously Apple (or simply the Engineer who create the method to display the data) feels csv IS the way to display the data. Files with Tab delimiter fields is not the preferred format (in Apple’s or Engineer’s mind).

So, the question is:

What name must I use to qualify the reading of a csv file: Import or Open ?

And, of course, I will use the other to read tab delimiter files.

What is your feeling on that subject ?

BTW: yes, I read the csv entry at WikipediA.

OK: if I am not crystal clear, think at The G.I.M.P. It have a Save MenuItem that save the graphics using its native file type (“.xcf”) and Export… / Export As…
In that case, Save is he application native file format and Export… / Export As… is… the Export file format (format to be read with other applications).


csv file with comma delimiter (Finder’s Get an Eye)


csv file with tab delimiter (Finder’s Get an Eye)

Nota: I do not set LibreOffice to be the default application. It claim that by itself !

I hope that I set the right caption to the right image 'cause Netinary (isp) is still filtering (to me) the image I store in MediaFire. Netinary is the McDonald’s French third party that adds free Wifi to these restaurants.

Import implies bringing content into an existing document. Open implies creating a new document for the content. Both can be used with native or non-native formats.

[quote]OK: if I am not crystal clear, think at The G.I.M.P. It have a Save MenuItem that save the graphics using its native file type (“.xcf”) and Export… / Export As…
In that case, Save is he application native file format and Export… / Export As… is… the Export file format (format to be read with other applications).[/quote]
In gimp, Save writes the format that was opened, not necessarily .xcf. Open can read a number of different formats. Save/Save As can write them. Export implies writing a format that the app doesn’t normally read.

That’s just a deficiency in Apple’s software.

I think you’re creating a false dichotomy.

Tim:
I feel different but a change may have been done some years ago in both cases.

I will only use the Export part.

Export is used to save the data into a file format used by other application. It means "save the data in a compatibility mode”; export as an open format.

The GIMP: the situation is as I describe, with the last versions (since Lion or Mt. Lion I think). I checked before sending the text. You may be right for older versions (or Windows version as I do not checked this one).

That’s just a deficiency in Apple’s software.
Or Engineed feeling. You can be right on this one too.

dichotomy
Yes, this can be.

This conversation is to get a consensus and act accordingly on the differences to set between Open and Import.

There is one thing I do not talk about and you point it to me is… Append. I have added an Append MenuItem who as its name imply, will append the newly selected file contents at the end of the current ListBox. This will act as your Import definition.

Oh. It seems that my definition for Open and Import only differs in the selected TEXT file extension .csv and .txt. I do not have set my mind on .csv is Import or Open and .txt is Open or Import. My choice is .txt is Open and .csv is Import, but I am dubitative, thus the question.

BTW: did you see the two screen shots ?

Since your app can infer from common extensions what is the format of the data, why not let people Open the documents with a known extension, and process them accordingly ? That is the way Excel works.

Import could be used for unknown extensions, or to force processing of a particular file. For instance to import a tab separated file that has the .csv extension, as you posted above.

In the case of the csv file that contains tab separated, though, you could recognize that, if upon load you find no nthfields, and find them with tab. Check on a few lines to see if fields are consistent, to avoid eventual random problems with tabs or commas used in fields.

Thank you all for your answers.