How do I convert CSV = > Excel in Alaska?
Re: How do I convert CSV = > Excel in Alaska?
There must be a way to get you through. I will talk to the guys who run the forum now (I initiated it years ago) and let you know.
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: How do I convert CSV = > Excel in Alaska?
"There are 2 kinds of people in this world, those with loaded guns, and those who dig. You dig!" - Clint Eastwood (The Good, The Bad and The Ugly)Roger, c'mon. It's sooooo much funnier to struggle with strange code from anywhere and for different languages than to just open a damned CSV file with Excel and save it afterwards.
"If your'e gonna shoot, shoot. Don't talk." - Eli Wallach (The Good, The Bad and The Ugly)
The eXpress train is coming - and it has more cars.
Re: How do I convert CSV = > Excel in Alaska?

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: How do I convert CSV = > Excel in Alaska?
Hi, Eugene.
If you give me a mail adress via PN, I will give it to the guys who run the forum and they will put it on a whitelist, okay?
If you give me a mail adress via PN, I will give it to the guys who run the forum and they will put it on a whitelist, okay?
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."
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: How do I convert CSV = > Excel in Alaska?
Gut. Vielen Dank! Ich habe dir in PM geschrieben
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: How do I convert CSV = > Excel in Alaska?
Roger!
Thank you very much! I tried using the function you gave me. What can I say? It converts a CSV file to an XLS file. However, in the Excel file, data from the CSV file is placed in one column, and there are 8 of them. if you enter this CSV file in Excel using Excel itself as text data, then you can create a separator in the dialog. Is it possible to set the separator in your function as a function parameter? And more. The function works very slowly. Files attached
Thank you very much! I tried using the function you gave me. What can I say? It converts a CSV file to an XLS file. However, in the Excel file, data from the CSV file is placed in one column, and there are 8 of them. if you enter this CSV file in Excel using Excel itself as text data, then you can create a separator in the dialog. Is it possible to set the separator in your function as a function parameter? And more. The function works very slowly. Files attached
- Attachments
-
- 1.zip
- (15.98 KiB) Downloaded 726 times
Re: How do I convert CSV = > Excel in Alaska?
Hi Eugene,
Don't forget you need to have Excel on your PC to use the activex. This isn't 'universal'.
If this isn't a problem, you can load the csv into an array, and then save it to XLS. If you use 'blocks' of data it will be much faster. If this can help you, I can send you some code as a sample.
You can split the array in blocks of 500 lines, and then send a block to Excel. I tested on this some years ago, and this seems to be the fasted way.
That external lib claims to be very fast, I never used it. Most of my customers have Excel on their system.
Don't forget you need to have Excel on your PC to use the activex. This isn't 'universal'.
If this isn't a problem, you can load the csv into an array, and then save it to XLS. If you use 'blocks' of data it will be much faster. If this can help you, I can send you some code as a sample.
You can split the array in blocks of 500 lines, and then send a block to Excel. I tested on this some years ago, and this seems to be the fasted way.
That external lib claims to be very fast, I never used it. Most of my customers have Excel on their system.
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: How do I convert CSV = > Excel in Alaska?
Hi, Chris!
Of course, the implementation of your function is of interest to me. I also used blocks in Excel, but for converting xls=>dbf. This really accelerated processing very much. Converting csv=>xls takes a long time if the csv file is large. And if it is large, you can't put it (all of it) in the array. And if it is small, then it should be placed in the array, and so it works normally. It turns out that it is necessary to convert the file. We will assume that Excel is available on all computers, and if it is not-then a reasonable message should be issued to the user.
Of course, the implementation of your function is of interest to me. I also used blocks in Excel, but for converting xls=>dbf. This really accelerated processing very much. Converting csv=>xls takes a long time if the csv file is large. And if it is large, you can't put it (all of it) in the array. And if it is small, then it should be placed in the array, and so it works normally. It turns out that it is necessary to convert the file. We will assume that Excel is available on all computers, and if it is not-then a reasonable message should be issued to the user.
Re: How do I convert CSV = > Excel in Alaska?
This is from DC_Array2Excel(). It shows how to test for Excel installed.We will assume that Excel is available on all computers, and if it is not-then a reasonable message should be issued to the user.
Code: Select all
oExcel := CreateObject("Excel.Application")
IF Empty( oExcel )
IF lCSVFallBack
DCMSGBOX 'Excel is not installed. Create CSV file instead?' YESNO TO lStatus
IF lStatus
RETURN DC_Array2CSV(cExcelFile,aData)
ELSE
RETURN .f.
ENDIF
ELSE
DC_WinAlert( "Excel is not installed" )
ENDIF
RETURN .f.
ENDIF
The eXpress train is coming - and it has more cars.
Re: How do I convert CSV = > Excel in Alaska?
The oExcel:Workbooks:Open() method is not recognizing that you have comma-delimited data in your CSV file. By default it probably expected TAB delimiters.However, in the Excel file, data from the CSV file is placed in one column, and there are 8 of them.
Change your open method call to this:
Code: Select all
oBook := oExcel:Workbooks:Open(cCsvFile,,,2)
The eXpress train is coming - and it has more cars.