Roger,
An odd request.
We have a user whose holding company wants file contents every night sent to them on a half dozen file. We sent via csv (with just copying/renaming dbf file) and they said it was ok, but looked like an xls, which it would. We renamed them to xls. Then they said they needed it to be a real csv.
We then copied using a copy to... delimited. (used that for 20+ years for csv)
Now they do not want quotes. Never heard of that even being an option on any export, unless you manually do it field by field with a comma in between. And somehow handle the fields with commas.
(which I will not offer and it would cost them a fortune in hourly work)
Anybody have any thoughts..other than to tell them to go jump....
Thanks
Fred Omni
Excel
Re: Excel
Hi, Fred.
There is no definition for sequential files containing "comma separated values" or "character separated values", what "CSV" stands for. There is something like a definition in RFC 4180 (https://tools.ietf.org/html/rfc4180), but different to other formats, there is no standard. The separation character can be a comma or a semicolon (or maybe a plus sign), values can be quoted or not (or mixed!), the decimal sign can be a comma or a point, there is no standard character set (ANSI, OEM, UTF-8, UTF-16, whatever) that's f*cking life. We created input- and output-routines handling that, controlled by user-input. It's not a really big problem to especially write output-routines with various options. If textes are not quoted, just remove the separation character from them, or translate it to a different character (or show a warning).
As a very good programmer said to me years ago: Think of the future! If you create a function, class or so, just think of way may happen in the future to the programs using those functions. If you design them in a way which gives maximum flexibility and comfort, you don't get that kind of problems if users show up and ask for improvements.
There is no definition for sequential files containing "comma separated values" or "character separated values", what "CSV" stands for. There is something like a definition in RFC 4180 (https://tools.ietf.org/html/rfc4180), but different to other formats, there is no standard. The separation character can be a comma or a semicolon (or maybe a plus sign), values can be quoted or not (or mixed!), the decimal sign can be a comma or a point, there is no standard character set (ANSI, OEM, UTF-8, UTF-16, whatever) that's f*cking life. We created input- and output-routines handling that, controlled by user-input. It's not a really big problem to especially write output-routines with various options. If textes are not quoted, just remove the separation character from them, or translate it to a different character (or show a warning).
As a very good programmer said to me years ago: Think of the future! If you create a function, class or so, just think of way may happen in the future to the programs using those functions. If you design them in a way which gives maximum flexibility and comfort, you don't get that kind of problems if users show up and ask for improvements.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Excel
hi,
what do they want to have : CSV to import or "ready" XLSx
i guess they want a XLSx and ask for CSV while your "Trick" does not work with newer Excel Version.
DBF Converter is default NOT installed so DBF is a "unkown" Format.
---
if they real want CSV i recommend to use FCREATE() / FWRITE() instead of xBase Command ...
what do they want to have : CSV to import or "ready" XLSx
i guess they want a XLSx and ask for CSV while your "Trick" does not work with newer Excel Version.
DBF Converter is default NOT installed so DBF is a "unkown" Format.
---
if they real want CSV i recommend to use FCREATE() / FWRITE() instead of xBase Command ...
greetings by OHR
Jimmy
Jimmy
Re: Excel
Don't forget, you have "DC_WorkArea2CSV()" and "DC_Array2CSV()" in eXpress++, so maybe you don't need to write or create anything. Just look at the docs.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Excel
I saw one solution, how realise universal system for CSV file, this is not simple CSF file, but principe is :
txt file has header where is definition of used delimiter,
program read this and then use it for delimiting.
nice is that this delimiter can be changed also inside CSV file, for example when delimiter is semicolon, and I need use semicolon in some text string, I can change delimiter to hash and
row is processed correctly.
So it is not universal system, need own function to read it, cannot direct load to Excel.
I mean semicolon is better delimiter than comma, because text string often have some comma
txt file has header where is definition of used delimiter,
program read this and then use it for delimiting.
nice is that this delimiter can be changed also inside CSV file, for example when delimiter is semicolon, and I need use semicolon in some text string, I can change delimiter to hash and
row is processed correctly.
So it is not universal system, need own function to read it, cannot direct load to Excel.
I mean semicolon is better delimiter than comma, because text string often have some comma
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Excel
All this is true. There doesn't seem to be a single simple standard for CSV files. But oddly enough, there are online services that work well with all the variety of blurry CSV file standards.
https://convertio.co/ru/csv-xls/
https://onlineconvertfree.com/ru/conver ... sv-to-xls/
https://convertio.co/ru/csv-xls/
https://onlineconvertfree.com/ru/conver ... sv-to-xls/