开发者

Open excel file

I need to open a excel file to see the markup. the xml format. I wont to op开发者_开发技巧en the markup of Office 2003 file in any editor. Any ideas?


Do you mean programmatically or using an editor. If you are using a new version of excel you should be able to open the file using a text editor like notepad++ or textPad. http://notepad-plus-plus.org/ http://www.textpad.com/

If you want to do it programmatically you'll need to tell us what language you want to do so in.


Microsoft office 2007 on wards, the office files are stored in xml format (office open xml package). Earlier versions (2003 and below) are not stored as xml files. So you cannot see markup of xls files. Off course you can see markup of xlsx file. You do not require any editors. If you have WinRar installed in your system, that is sufficient to open any MS-Office file.
If you are trying to open it programmatically, then you will get DocumentFormat.xml.dll library (its free) (for .net) and OpenXml4J (for java).


Xlsx

.xlsx files are zipped collections of xml files. You can look at them using the productivity tool that ships with the following library:

http://www.microsoft.com/en-us/download/details.aspx?id=5124

Its not great - the validator doesn't pick up everything + the documentation is rubbish. The best way to look at files in it is to use the diff (even if you just diff a file with itself). That essentially lets you look at each xml file within the zip. You can also copy + paste stuff out.

The library itself basically gives you a type-safe(ish) version of the raw xml. It's a real mess - basically maps onto what you see in excel + is a nightmare to write and query. Better than nothing though!

If you want to access them in a primitive way programmatically (eg to do regression testing - (checking that files are the same/similar)) you can do the following:

You can also look at them in C# by opening a stream on the file then opening the file as a package. Within the package will be multiple parts which you can open streams on.

You can also just rename the files to .zip and then extract them. If you want to edit them by hand though you'll be in for some fun and games!

Others

I dont think any of the above methods will work for older versions of the format though - not sure. Dont know what Office 2003 produces

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜