From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3e6c98a1a7cab60a X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: import Excel file Date: Tue, 15 Jun 2004 07:51:18 +0200 Organization: AdaCL Message-ID: <3232546.XtNgOWSx3K@linux1.krischik.com> References: Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1087280610 00 829 pqUSX3xOwKe34y5 040615 06:23:30 X-Complaints-To: usenet-abuse@t-online.de X-ID: bixS14ZEZel1uzOnk3BpsA1lHjg+XfmMWk5T+luisMHEDRdh2sL3QJ User-Agent: KNode/0.7.7 Xref: g2news1.google.com comp.lang.ada:1492 Date: 2004-06-15T07:51:18+02:00 List-Id: Tanker wrote: > Hi, > > I want to import data from an ms exel file in my program. Can someone give > me a hint how I can realize that. I already tried to read the exel file as > a text_io and sequential_Io file but it's not possible as Text_IO 'cause > it must be a sequential_IO (or direct_IO) file. The problem with the > sequential_IO is, that i can't figure out how the form and substance of > the file looks like (is it a record, what kind of record(contents)?) I take it that you have some documentation on the format of excel and that you are willing to take the effort of reading a binary file. Since the excel format containts loot of different data the answer are streams. Ada streams are the File IO to read different types. An integer is read by: A : Integer := Integer'Input (My_Stream); Integer'Read (My_Stream, A); A X Character String by: type X_String is new string (1 .. X) X : X_String := X_String'Input (My_Stream); X_String'Read (My_Stream, X); Beware: There is a important difference between 'Read and 'Input: 'Read is more low level and 'Input more high level. i.E. String'Input expect the length of the string to be part of the input data - String'Read does not. However, in the example I have given I used X_String of the defined length X - since the length is known X_String'Read and X_String'Input should work the same. With Regads Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com