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
 Origin Forum
 csv import, set colums as X,Y
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Milchy

5 Posts

Posted - 06/19/2023 :  08:11:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Ver: Origin2023

Hello, I am importing .csv through the wizard, it has 100+ columns, certain LongNames should always be set as the X columns. I can do it manually in the preview window before finalizing the import.

Is there any automatic way to do this?

YimingChen

1593 Posts

Posted - 06/19/2023 :  09:03:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You may need LabTalk script after import for such. On the last page of the import wizard, check the box Save Filter and Specify advanced filter options. Then click Next button. In the next page, enter the following script. Change ln to the longname of the columns to be set to x.

for (int i = 1; i < wks.ncols; i++) {
	if (wks.col$(i).lname$ == "ln") {
		wks.col$(i).type = 4;
	}
}




James

Go to Top of Page

Milchy

5 Posts

Posted - 06/26/2023 :  01:21:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks! Works great!!!
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