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
 Import files names into a column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

eraoult

France
1 Posts

Posted - 09/17/2018 :  10:05:10 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I try to read some .txt files with the tool "Import multiple ASCII" and it work, i can create different columns with it. However, i want also to obtain their names files and extract them in a additional single column.

I try to use the "script after each file import" option but i not succeed to find the correct fonction.

Any help?

Thanks in advance :)

yuki_wu

896 Posts

Posted - 09/18/2018 :  01:33:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I suppose you are importing multiple files to Origin with starting new columns for each file, right?

If so, you could try:


Then add the script in Script After All Files Imported:
//Add a new column
col(wks.nCols)[L]$= FileName;
int ncols = wks.ncols;
//Loop over every column
loop(ii, 1, ncols - 1)     
{
	//Put the content of SourceFile to the last column 
	col($(ncols))[$(ii)]$ = col($(ii))[D1]$;
}


Hope it helps.

Regards,
Yuki
OriginLab
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