hi is there any way to convert a Excel 2000 file to a .csv (; separator file) fully with pure asm win32
i need to compute datas from xls files and right for now have done the job for the .csv ones (converted by ecxel) so if i can convert thies .xls into .csv my prog will be faster than manualy convert files into the good format for my prog

thanks for helping

Win32 asm is just too much cool !
Posted on 2003-04-27 15:41:02 by Thor0Asgard
Weeh, nice avatar... good old link :)

I'd say forget parsing the .xls files manually. Afaik, there's no conclusive documentation on them (except perhaps in subscriber-only MSDN (that's the FULL deal, not just PlatformSDK or the MSDN CDs you get with visual studio)) - besides, it will be a lot of work.

Your best bet is probably to make excel do the work for you. Either by manually sending windows messages (ick :P), or by some OLE Automation (which I never worked with).
Posted on 2003-04-27 15:54:34 by f0dder
I dont know what the .csv file is... but if Excel can convert it, it very likely you can also automate Excel to do the same thing.

I have sucessfully automated both Excel and AutoCad together under one MASM application. I can help you design your own if you like, but i would take your questions to the COM section, cause there is alot of COM work to do this. Dont fret too much to, Japheth's COMView tool will save you 80% of the hardwork ;)

:NaN:
Posted on 2003-04-27 16:07:54 by NaN
NaN, .csv's are those comma separated files (Comma Separated Values?).
Pretty easy to parse text format :-)
Posted on 2003-04-27 16:15:28 by f0dder
Useful infos here : http://www.asmcommunity.net/board/index.php?topic=11894&highlight=BIFF

NaN's example is very nice and works flawlessly...

May the Triforce be with you. ;)
Posted on 2003-04-27 17:21:11 by JCP
That there is a ODBC data link to Excel. And with the help of the ODBC MASM programming on this board, You should be able to skip the csv step altegether.

Regards, P1

PS: You do need to have your own copy of Excel on your system to do this.
Posted on 2003-04-28 09:15:52 by Pone
Thor0Asgard,

If you really intend to work directly with any MS Office file format be prepare to spend at least couple of month to collect and arrange existent information. I mean there is "official" documentation, but it cover no more than 25% and have many incorrectness (I know what I'm talking about :))
You have 3 choice:
1. Dig inside binary format (I suggest you download filter sources from OpenOffice.org) - spend at least 3-4 month
2. Try to use Microsoft's converters available in \Common Files\Microsoft Shared\TEXTCONV\ - about couple of hours
3. Try suggestions above - couple of hours too

Choice is yours :)
Posted on 2003-04-30 03:50:31 by masquer
Actually Excel fully support DDE, that might be the best way to transfer data to and from Excel and your program. It allows you to use the functionality of Excel within your asm program. Never really implemented it before but it would be cool to see it though.
Posted on 2003-04-30 17:13:03 by donkey
IMHO, masquer is being a bit extreme in his budget... it took me roughly a week to hack out and understand the XLS file format with BIFF8.

Im not saying it was easy. Its not, its actually kinda complicated, but if i had to, i could start writing my own file generator tomorrow... (I posted all my sources in the link Readiosys has shown).

I dont think this is the way to go, but i dont think the above estimate was entirely accurate as well.

:NaN:
Posted on 2003-04-30 18:15:44 by NaN
NaN, how much of the xls file format is that though? And which version?
Posted on 2003-05-01 02:15:43 by f0dder
NaN,

maybe I'm exaggerate a little bit, but I do it with purpose. From Thor0Asgard's post it is not clear about complexity of his task. If xls file to process is simple enough or in some earlier version (f0dder is right - less version less complex) it could be done within couple of weeks.
Simple enough I mean no formatting, no merging, no formulas and many others no.
Actually I'm currently working with one of the office format, not xls but roots are the same :)
Posted on 2003-05-01 03:28:12 by masquer

NaN, how much of the xls file format is that though? And which version?


Excel BIFF8. Which represents Excel97/2000 (etc). To my knowledge there isnt any higher BIFF formats than 8. (Could be wrong tho).

:NaN:
Posted on 2003-05-01 17:27:00 by NaN
i have a simple .xls file with a unique Sheet
i need to export values from my sheets cells,compute them and then write back the
computed data into a new .xls file
i haven't had the time to watch NaN's sample but it seems to be very interresting and powerfull

what i have understand is that .xls is BIFF 8 (for Office 97/2000)
and the BOF is 0809 (remember the byte order)
but when i hex view my .xls it is not the start of my file.....
NAN maybe you can adjust your code to do a .xls Converter
it will be usefull to Convert Data From/To .xls files

anyway thanks all for your work and hope i'll can do something nearly aproaching what i had in mind (with your help i have 99% more chance to do it)
Posted on 2003-05-02 03:52:17 by Thor0Asgard
Then you certainly have to look at DDE samples at this board. Try to search with DDE keyword. To read and moreover to write correct binary data almost imposible, except there's plenty of time...
Posted on 2003-05-02 04:20:08 by masquer
http://www.wotsit.org is a great place for all your file format needs, including Excel's many formats. As a programmer, this site will be a place you will go to frequently.

Paul
Posted on 2003-05-12 01:57:48 by PBrennick
pbrennick,

Uhm, please, read my first post in this thread, it is about completeness of official documentation :grin: :grin: :grin:
Posted on 2003-05-12 02:13:51 by masquer

i have a simple .xls file with a unique Sheet
i need to export values from my sheets cells,compute them and then write back the
computed data into a new .xls file
i haven't had the time to watch NaN's sample but it seems to be very interresting and powerfull

what i have understand is that .xls is BIFF 8 (for Office 97/2000)
and the BOF is 0809 (remember the byte order)
but when i hex view my .xls it is not the start of my file.....
NAN maybe you can adjust your code to do a .xls Converter
it will be usefull to Convert Data From/To .xls files

anyway thanks all for your work and hope i'll can do something nearly aproaching what i had in mind (with your help i have 99% more chance to do it)


I dont know how i can impress upon you that to manually extract BIFF data is a very tall order to ask for. Like you, when i came to this topic, i thought the same. I didnt want to waste time in learning more than i need, i simply wanted to modify raw data and replace it. But BIFF8 is complicated, and not well documented. It took me a couple weeks to figure it out (on paper) and just what i would need to code up to do anything with it.. Thats when i discovered VBA interfaces. They allow me to skip all the BULL and allow excell to do all the low level dirty work. I promise you the overhead is 2/3 less than raw BIFF8 coding (im assuming you never touched COM before). I would be glad to answer questions if you do take the COM route with VBA interfaces. Between Japheth's COMView tool, and my time spent piddling with Excel and AutoCad, im sure i can help you to what ever your aiming to do.. Alternately, i would need to brush up on my BIFF8 stuff (it *IS* complicated ~ many layers of abstraction in the file ~ even floats are encoded with a special compression).

:alright:
NaN
Posted on 2003-05-12 18:35:18 by NaN