Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Tools Development (http://www.baanboard.com/baanboard/forumdisplay.php?f=8)
-   -   Can seq.open and seq.gets use with Excel file ? (http://www.baanboard.com/baanboard/showthread.php?t=56184)

teddybear 22nd June 2009 09:04

Can seq.open and seq.gets use with Excel file ?
 
Hi there,

May I know if this is possible,

What I did currently is to convert the .xls file to .csv file. This mean an extra steps for the user.

Thanks in advance.

zardoz 22nd June 2009 10:08

With seq.gets you can always open a file, but you must also consider that you have to 'interpret' the excel format... not easy to do.

Another way could be to create an excel sheet that contains a macro that converts to .csv the other sheet and launch it from baan, then after read the .csv file normally. In this way tha user has nothing to do.

teddybear 22nd June 2009 10:44

Hi zardoz,

Thanks for the reply.

Let say I use csv file format, I know I can use seq.gets to read the line form the csv file. May I know how can I start reading from, let say, line 10 and skip those lines before line 10.

Can I use seq.seek for this purpose. If yes, what should I select for the first argument, as it is in byte ?

Thanks in advance.

george7a 22nd June 2009 12:16

Hi,

Why don't you use seq.gets 10 times?
Code:


for i = 1 to 10
  rt=seq.gets(line, MAX_LINE, index.file)
endfor
rt=seq.gets(line, MAX_LINE, index.file) | this will be the 11th line

- George

teddybear 23rd June 2009 02:36

Hi george7a,

Thanks for the suggestion. I am sure that will works.

But I just wondering how the seq.seek works, especially on the first argement.

george7a 23rd June 2009 07:27

Hi,

As you can see in the help files, the first argument is the offset. It is the new file position, as a number of bytes. Here are some examples:
http://www.baanboard.com/baanboard/s...light=seq.seek
http://www.baanboard.com/baanboard/s...light=seq.seek

I hope it helps,

- George

falessan 1st September 2017 09:22

How did you convert the .xls file to .csv file. ?
 
Quote:

Originally Posted by teddybear (Post 155408)
Hi there,

May I know if this is possible,

What I did currently is to convert the .xls file to .csv file. This mean an extra steps for the user.

Thanks in advance.


What I did currently is to convert the .xls file to .csv file.???


All times are GMT +2. The time now is 22:43.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com