The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 impASC to certain columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

BurningDaylight

Germany
2 Posts

Posted - 08/30/2017 :  07:34:10 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm trying to specify the output range for impASC, but it continues to import data to the first column in the sheet. Is it possible to make it put the data in the columns 5:10, for example?
Here is what I tried:
impasc orng:=[Book1]Sheet1!2:6 Options.Names.FNameToBk:=0 Options.Names.FNameToSht:=0 Options.ImpMode:=0 ;

But it still fills columns 1:5

Edited by - BurningDaylight on 08/30/2017 07:35:08 AM

Hideo Fujii

USA
1582 Posts

Posted - 08/30/2017 :  11:15:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi BurningDaylight,

It seems impASC was not designed to accept the column range for output, maybe because it is a risky operation
when the number of imported columns (which is unknown before importing) may be larger than the number of specified columns.
As alternative, you can import by setting the Import Mode to Start New Columns (options.ImpMode:=1),
and move the imported columns to the destination by colmove x-function such as:

nc1=wks.ncols+1;
impASC  ... options.ImpMode:=1 ;
nc2=wks.ncols;
colmove rng:=wcol(nc1):wcol(nc2) operation:=pos col:=col(2); //Note: Output column is only specified the starting position
Of course, you can also put this colmove line in options.Script.RunScriptAfterEachImport option, if you like.

Hope this helps.

--Hideo Fujii
OriginLab

Go to Top of Page

BurningDaylight

Germany
2 Posts

Posted - 09/04/2017 :  1:10:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Hideo Fujii

move the imported columns to the destination by colmove x-function


Thank you! This is indeed a a viable workaround.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000