Excel

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Excel

#1 Post by omni »

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

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Excel

#2 Post by Tom »

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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Excel

#3 Post by Auge_Ohr »

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 ...
greetings by OHR
Jimmy

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Excel

#4 Post by Tom »

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."

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Excel

#5 Post by Victorio »

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

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Excel

#6 Post by Eugene Lutsenko »

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/

Post Reply