[scilab-Users] Reading an Excel file with mixed strings and numbers

Petter Wingren petterwr at gmail.com
Sun Nov 20 13:57:44 CET 2011


Thanks a lot for the input, will probably use some of this in the future
when I aim for a fully automated script.

I found my mainproblem now however, due to some formatting error every cell
in the excel sheet started with a ' .
After I removed that everything worked just fine :)

On Fri, Nov 18, 2011 at 2:47 PM, Samuel Gougeon <sgougeon at free.fr> wrote:

> The whole example, with some slight improvements:
>
> [fd, SST, Sheetnames, Sheetpos] = xls_open('file.xls');
> [Value, trash] = xls_read(fd,Sheetpos);
> mclose(fd);
> d = getdate((Value(4:$,1)-25569)***24*3600);
> d(:,9) = round(d(:,9)+d(:,10)/1000);
>
> d = d(:,[6 2 1 7 8 9]);
> datesText = msprintf("%02i/%02i/%04i %02i:%02i:%02i\n",d(:,:));
>
> -->datesText
>  datesText  =
>
> !21/11/2010 20:43:00  !
> !                     !
> !21/11/2010 20:43:10  !
> !                     !
> !21/11/2010 20:43:20  !
> !                     !
> !21/11/2010 20:43:30  !
> !                     !
> !21/11/2010 20:43:40  !
> !                     !
> !21/11/2010 20:43:50  !
> !                     !
>
> ...
>
> Samuel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20111120/f2317217/attachment.htm>


More information about the users mailing list