Monitor export is not really CSV

For user who dont speak german please use this part of my forum
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Monitor export is not really CSV

Beitrag von bbstrikesagain »

It outputs semi-colon ";" instead of Comma "," Separated Values.

It's trivial to fix using any text editor, but in future maybe CSV could really be CSV?

So far I don't think I'll use this function much anyway, since:
  • it doesn't cover a long enough time interval e.g. 1 hour
    it resets when I leave the monitors section
Great idea though! Maybe it could be improved a bit, that's all.
Normally aspirated engines suck
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

It outputs semi-colon ";" instead of Comma "," Separated Values.
Both versions are CSV-conform. I did optimize it for Excel 2007. Excel does autodetect only semiclon-values when opening the file directly. If i use , then you have to import the file into Excel with need to tell Excel that , is used. Interesting Detail: Outlook autodetects only , and not ; ;-)
it doesn't cover a long enough time interval e.g. 1 hour
Sorry, this is a bug. I planned the Monitor-Graph for 400 Steps which are 30 Minutes. But i forgot to increase tha Max-Value.
it resets when I leave the monitors section
The monitor does block the interface every 5 seconds. It would make problems to run this process in the background the whole time (during sync, filetransfer,...)
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

"Comma" Separated Variables

Beitrag von bbstrikesagain »

I think CSV started life as "comma", and that's all that many applications can still open by default, e.g. file associations, e.g. for Office 97/XP/2003, so comma seems safer than semi-colon.

Of course almost anything can be handled by import, so it's not a big problem, but if there's a choice then maybe "," makes sense.

Or are there some cases where "," is already in the data so you prefer ";"? But what if ";" was in the date. How about tab delimited files?

I look forward to the bug fixes.
Normally aspirated engines suck
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

I think you did not understand me. This file will be opened with Excel.
I have installed Office 2007
When i doubleclick a csv-file with ; then Excel shows it correct
When i doubleclick a fcsv-file with , then Excel shows it NOT correct

The , or ; inside the data are never a problem cause all values are quoted.
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Beitrag von bbstrikesagain »

FJ hat geschrieben:I think you did not understand me. This file will be opened with Excel.
I have installed Office 2007
When i doubleclick a csv-file with ; then Excel shows it correct
When i doubleclick a fcsv-file with , then Excel shows it NOT correct
Okay, Office 2007 is really crazy (there's lots of other evidence for that). I just tried it, and Comma doesn't work by default in a *.csv file!!!! You can still use the file open dialogue, and then enable the comma delimiter option in the Text Import Wizard, but you have to do it every time.

The problem is, in older Excel versions only the genuine Comma "," works - it has always worked perfectly for 97/2000/XP/2003 versions. Those versions don't work with semi-colon ";" either! What's more, if the file is called *.csv, then even using the File Open dialogue doesn't help us - no wizard appears because the old Excel knows that only commas are allowed!

So , you can't have one *.csv file that works with both old and new?

Maybe csv should really be csv. 2007 Excel has the file open workaround, and maybe MS will fix this fault, but until then...

The best answer could be to save the CSV as *.txt, then the import wizard and options become available in any version of Excel...
Normally aspirated engines suck
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Beitrag von bbstrikesagain »

or offer csv with "," or ";" choices at export time?
Normally aspirated engines suck
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

or offer csv with "," or ";" choices at export time?
I don't like a seperate setting for each tiny little thing. Do you know the behavior of Outlook 2010 ?
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Beitrag von bbstrikesagain »

Sorry, I don't have access to Office 2010, but I'm shocked that 2007 gets it so wrong...
Normally aspirated engines suck
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

"Locale-Specific-Delimiter" Separated Variables or

Beitrag von bbstrikesagain »

Reading around it seems that it's a Vista / Windows 7 Excel 2007 problem, not a problem even with Excel 2007 on XP etc. The Excel 2007 I tried was on Windows 7.

Maybe with Vista or 7 and Excel 2007 a lot of people are having problems sharing CSV with co-workers using other systems, because of the inconsistent, locale and O/S specific, handling of ";" and ",''"?

I think that now, since the arrival of Vista, the only safe way is a text file, so the Excel wizard can be used.

http://jstsch.com/post/excel_2007_handling_of_csv_files
http://blogs.msdn.com/michkap/archive/2 ... 70413.aspx
Normally aspirated engines suck
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

I think that now, since the arrival of Vista, the only safe way is a text file, so the Excel wizard can be used.
I don't like this solution. I will install on Win7 to check out if its working there with comma.
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Beitrag von bbstrikesagain »

Summary:

Windows 2000/XP, Excel 97/2000/XP/2003, Default UK settings, at three employers and at home, all work perfectly with "," - it's the standard in the UK, and in the semiconductor business, for datalog files from German colleagues. Cannot open with ";" unless you call it something else (e.g. *.txt and not *.csv) so that the wizard will work.

Windows 7, Excel 2007, Default UK settings - needs ";" for double click, but can now use the wizard even with CSV files, to work with either ";" or ",".

Of course Open Office works as expected, but it lacks the power of Excel.

It's an Excel / Windows problem, but I think it's pushed you in the wrong direction.
Normally aspirated engines suck
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

f.e. MyPhoneExplorer does autodetect the correct seperator -> both methods work for import.
But how should we handle it for the CSV-Exports now in MPE ?
Does OpenOffice autodetect the seperator ?
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Beitrag von bbstrikesagain »

OpenOffice Calc opens a single page Wizard when opening a CSV or similar.

The wizard defaults to comma "," (at least in my UK locale).
The preview is correct already for true CSV with "," so I can just press [OK]. It's one more step than older Excel flavours, but let's you see better what you're doing.

For not-quite-CSV files (with with semi-colon ";" delimiters) the preview is clearly wrong, but I can just enable the semicolon check box and press [OK].
Normally aspirated engines suck
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

OK, i'll change all CSV-Exports to , in the next version
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Beitrag von bbstrikesagain »

So, with Windows 7, Excel 2007, and default UK regional settings, I tried Save as with various formats:
  • CSV (Comma delimited)
    CSV (Macintish)
    CSV (MS-DOS)
Using Notepad++ I inspected the saved files and they all:
  • (a) contain comma "," separators
    (b) re-open correctly with a double click
    (c) also open correctly on Excel 2003 on Windows XP etc...
The only differences are with the line and file terminations...


I repeated the Save As excercise with Excel 2003 on Windows XP, using the same three file type choices.
Again, all three files:
  • (a) contain comma "," separators
    (b) re-open correctly with a double click.
    (c) also open correctly on Excel 2007 on Windows 7 etc...
So, from my perspective, comma seperator works perfectly, MS Ofiice or Open Office, old or new... :-)

As mentioned originally though, files with semicolon cause problems , they can't be opened correctly with Excel 2003 and earlier :cry:
Normally aspirated engines suck
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

Beitrag von bbstrikesagain »

By the way, when exporting from MPE 1.7.5, monitors and calls both use ; (which gives me problems) but contacts still uses , and works perfectly.
Normally aspirated engines suck
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

As i told you: Outlook uses always , as seperator. No matter which locale is set. I did optimize the Contact-Export to Outlook, the rest to Excel.

I have found the exact reason for the behavior in Excel 2007: In Germany the comma is used as decimal-splitter and cause of this Excel cannot use it for CSV. If the Decimal-Splitter is set to "." and the List-Splitter is set to "," in the System-Settings then it will work also on a german PC with used comma as seperator. Result: I'll make a automatic detection so it should work in future with all locales automatically.
FJ
Site Admin
Beiträge: 32106
Registriert: Mi 15. Feb 2006, 01:16
Wohnort: Tirol
Kontaktdaten:

Beitrag von FJ »

Could you do one last test for me ?
Open the regional settings in control-panel and set "," for Decimal-Seperator and also "," for List-Seperator. Which file is loaded correctly by doubleclick ( , or ; ) ? Dont't forget to restore the old setting for Decimal-Seperator after testing !
bbstrikesagain
Beiträge: 59
Registriert: Di 6. Okt 2009, 10:26

test results

Beitrag von bbstrikesagain »

Setting decimal separator to comma (same as list separator):

Excel 2003 on Windows XP can now double click open CSV with ";" delimiters but now it doesn't succeed with ",".

So, I think Excel 2003 doesn't auto detect based on file contents. Aren't this things just great for making your life difficult...
Normally aspirated engines suck
Sebbl
Beiträge: 67
Registriert: Sa 24. Jan 2009, 08:37
Wohnort: Schwandorf
Kontaktdaten:

Beitrag von Sebbl »

Hello,

i use Windows 7 with Office 2010 beta. Both in x64 Version.
CSV with ";", like SMS-Export to CSV, are displayed correctly in Excel. For the Phonebook, wich is seperated with "," is display in one column, so I have to use the "Text in Spalten"-Assistant.

I think, that it is not relevant what sperator is used. CSV may not always mean "Comma seperated values". Another meaning is "Character seperated values". As CSV are unformated, they will be likely used to be parsed automatically. And therefor it is absolutely not relevant which seperator is used, as long as the values are correctly escaped with """.

I quote the German Wikipedia
Die CSV Dateien werden nicht immer auf die gleiche Art und Weise von denselben Tabellenkalkulationsprogrammen interpretiert:

* Microsoft Excel
o Öffnen durch Importieren aus Textdatei
+ Spaltenbreite wird an den Inhalt angepasst
+ Trennzeichen kann im Importdialog gewählt werden
o Öffnen durch Doppelklick
+ Alle Spalten haben die gleiche Breite
+ Trennzeichen ist stillschweigend Semikolon, wenn die CSV Datei nach ANSI-Norm gespeichert ist
This means Excel mit interpret files different if they are opened via double click or via import-assistant. And if the encoding is ANSI or Unicode
Antworten