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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 impASC (long and short names)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
OndrejMM Posted - 11/10/2008 : 6:30:52 PM
Hi,

I have a small problem, with importing,... when import via LabTalk both workbook' names are renamed after the file (i.e. long and short names),... I would need to specify that I want to "rename long name for book only",… I know how to do it manually but how can I specify this option when importing by means of the Labtalk script?

In other words I would need the short names of the newly created workbooks remind unchaged, i.e. book1, book2, etc.

Cheers
Ondrej

// Point to where the data files are
string path$ = "C:\X\";
// Find all files with wild card
findfiles ext:="*.dat";
int numFiles = fname.GetNumTokens(LF);
// Loop over all files
int nFirst = 1;
for(int ifile = 1; ifile <= numFiles; ifile++)
{
string filepath$, file$;
// Get next file name
filepath$=fname.gettoken(ifile,LF)$;
// Parse out just file name without path and without extension
file$ = filepath.gettoken(filepath.getnumtokens(\),\)$;
file$ = file.gettoken(1,.)$;

newbook;
impASC fname:=filepath$;

delete_file(filepath$);
};
4   L A T E S T    R E P L I E S    (Newest First)
OndrejMM Posted - 11/11/2008 : 4:35:03 PM
this is indeed useful,...
cheers, ondrej
cpyang Posted - 11/11/2008 : 11:37:10 AM
For programming help, best to use Originlab wiki site,

http://wiki.originlab.com/~originla/wiki/index.php?title=Main_Page

For the specific ascii import options, see this in the wiki:

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Importing_using_X-Functions

and


http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Data_Import#Partial_Import_with_Option_Settings

To see the listing of the options in each XF, do this

impasc -h

from the script window.


CP
OndrejMM Posted - 11/11/2008 : 05:47:08 AM
Hi Deanna,thanks it works! where can i find all this options? whatever I do I cannot find it in my help,... thanks,ondrej
Deanna Posted - 11/10/2008 : 8:30:38 PM
Hi, OnderjMM,

We can rename only the long name by setting options.Names.FNameToBkLnOnly to 1. The options variable of the impasc X-Function is a tree to control the import options. It has a branch called Names to control target workbook naming and the node FNameToBkLnOnly is for specifying whether to rename only the workbook.

Please try the following script:


fname$=system.path.program$+"samples\signal processing\fftfilter1.dat";
impasc options.Names.FNameToBkLnOnly:=1; 


Deanna
OriginLab Technical Services

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000