Highlighted
Absent Member.
Absent Member.
928 views

[archive] Excel CSV and Delimiters

[Migrated content. Thread originally posted on 05 April 2004]

We are writing a routine to export our data to an Excel CSV file. The export works just fine but reading it back in is a bit tricky if one of the Excel cells contains a comma. Excel will enclose that field with Double quotes. This sort of makes the import much trickier. Does anyone know how to force Excel to always use Double quotes?
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Excel CSV and Delimiters

If I understand you correctly, your COBOL app writes to a csv file and it reads from it?
This in order to communicate with Excel?

Right?

If so, why don't use Excel directly instead? The .csv file is really just an evil necessity that you don't really need?

Invoke Excel as a COM object (user doesn't have to see it) and pass the data straight over.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Excel CSV and Delimiters

This is fine but the data sits on a UNIX server. Our users access the program via a Thin Clinet application. One of the users (the guy footing the bill) wants to massage the data with Excel. What you suggest is an option. We were going that route becuase of problems with AcuODBC. BHut yesterday we resolved a major issue with it and it seems we can bypass that coding and have him use ODBC and Excel to handle this.
Thanks for the reply. You are correct that the csv is an evil step to avoid but you have to do what you have to do.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Excel CSV and Delimiters

I am pleased to learn you worked it out. One little note though...

One of my favourite demoes is to have the cobol application running on Linux. Using the thin client to provide a display on the client side with Windows and Office, the latter, in which we generate a mail merge on Word, based on a vision file the cobol app reads locally on the linux machine...

I promise you, I have seen this executing a number of times, but I still love seeing MS Word print neatly formatted letters under full control of ACUCOBOL-GT on a linux server, somewhere else in the world.

Take care.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.