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
 Importing problem, files not in order
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Mark H Ungurian

Canada
6 Posts

Posted - 07/13/2004 :  1:25:30 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi I'm using OriginPro 7.5SR4 but still can't figure out why origin doesn't rename the file/worksheets in order as they are selected? I have to import each separately.
Here is a sample of the listing shown in origin name & label panel;

SonicmistVe1>>>>>>H:\PDA2004\Test data from pda\Sonicmist _VelocityCalc#002.txt
SonicmistVe2>>>>>>H:\PDA2004\Test data from pda\Sonicmist _VelocityCalc#001.txt
SonicmistVe3>>>>>>H:\PDA2004\Test data from pda\Sonicmist _VelocityCalc#004.txt
SonicmistVe>>>>>>H:\PDA2004\Test data from pda\Sonicmist _VelocityCalc#003.txt

I've tried selecting files a few different ways, makes no difference.

Also I find that origin trauncates may long file names, maybe you can keep long file names in the next upgrade.

Any comments maybe helpful.
Thanks Mark

easwar

USA
1964 Posts

Posted - 07/13/2004 :  1:58:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mark,

I presume you are using the Import Wizard in version 7.5 to import multiple files. If that is the case, the order depends on what Windows determines the order to be - it is currently not possible to reorder the list in Origin prior to importing. And the Windows order does not always follow alphabetic sorting based on file names.

If you use the Import Multiple ASCII menu item or button, which also existed in earlier versions, then you can sort the list of files you select based on name, size etc. However, that does not use the new Import Filter mechanism.

We are planning on resolving this issue by allowing the user to sort the list by name, size etc. in the Import Wizard, in the next version.

As for long file names, we are working on resolving that issue as well. Note that currently you can place the entire file name into the page label.

Easwar
OriginLab

Go to Top of Page

Mark H Ungurian

Canada
6 Posts

Posted - 07/13/2004 :  2:08:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar ,
If OriginLab implements these changes you will have a better product for everyone. Thanks again.
MHU

Go to Top of Page

ftalbot

France
Posts

Posted - 04/12/2005 :  09:59:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi I also ran into the same problem as Mark:
when importing numerous files with the "import multiple ascii" button, Origin 7.5SR4 messes up the names.
I think it is indeed because my file names are too long: It is not possible to give a worksheet an name that is longer than 13 characters. Therefore, Origin truncates the file names and if the names have a common 13-letter base, it truncates the first one and has to rename the remaining worksheets.
Has there been a correction to that?
And is it worth trying to implement my own import routine in OriginC?
Or is this worksheet-naming limitation also in OriginC (the help file doesn't say)?
Go to Top of Page

easwar

USA
1964 Posts

Posted - 04/12/2005 :  10:13:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

So there are two issues:
1> The ordering of files when multiple files are imported - currently the order is based on what Windows decides and user cannot over ride.
This problem will be solved in the next version

2> Handling long file names - the names get truncated etc when assigning names to the worksheet
Currently what you can do in 7.5 is to check the "Set Worksheet Label to File Name" check box on the first page of the wizard and optionally uncheck the "Rename worksheet to File Name" check box. Then the entire file name will be placed in the Label property of the worksheet. The Label can be displayed on the worksheet title bar as well as it is shown in Project Explorer. By default, the label in Project Explorer is at the end but it can be dragged and placed right next to the Name column.

Easwar
OriginLab

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/12/2005 :  10:32:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
When importing with the Import Multiple ASCII button you can solve your problem by choosing the proper ASCII Options. While the wks you normally use is active select File > Import > ASCII Options, click Other Options and uncheck the Rename Worksheet to Data File Name option. Then in the ASCII Options dialog click Update Options. Finally, close the dialog and save the template. After that files will be imported to worksheets with generic names (Data1, Data2, etc).

If you want to use the file name as a label in the worksheet's title bar select Tools > Worksheet Script and enter this command in the edit box...

page.label$=%A;

Then check the Run Script Automatically after Import option and click Update. Finally, select Window > Rename, choose the Both Name and Label option and save the template.

Mike Buess
Origin WebRing Member
Go to Top of Page

winflowers

USA
34 Posts

Posted - 01/27/2006 :  09:53:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I got a problem with worksheet label. Currently, the worksheets use the full paths of the imported files as the labels. But it is not convenient to see the whole path when the path is very long. Is it possible to only use the file name instead of full path name as the label?
Thanks!
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/27/2006 :  10:43:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you use the Worksheet script method suggested above replace the page.label$=%A; with this...

for(i=1;i>0;i++) {
%F=%[%A,#i,\];
if(%F=="") break;
%L=%F;
};
page.label$=%L;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/27/2006 10:45:07 AM
Go to Top of Page

Mike

USA
357 Posts

Posted - 01/27/2006 :  10:44:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi winflowers:

If you are importing via the Import Wizard, selecting Set worksheet label to file name on the Source (1st) page of the Wizard, should insert just the file name in the worksheet title area -- no path info. The path info only appears in the label if you select Rename worksheet to file name. Incidentally, the path info is hidden if you select both of these checkboxes.

Mike
OriginLab

Go to Top of Page

winflowers

USA
34 Posts

Posted - 01/30/2006 :  07:00:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank Mike Buess and Mike. But I am using "Import ASCII" or "Import multiple ASCII" to import the data with saved template. Is there still possibility to only save the file name in the label field of the worksheet? I have tried different options, but couldn't figured it out.
If I use OriginC to import the data with saved template, how could I write the code to only save the file name instead of full path in the label field of the worksheet?

Thank you in advance!
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/30/2006 :  07:56:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The method I discussed above is used with "Import ASCII" and "Import Multiple ASCII". Open your wks template, select Tools > Worksheet Script and enter this script in the edit box...

for(i=1;i>0;i++) {
%F=%[%A,#i,\];
if(%F=="") break;
%L=%F;
};
page.label$=%L;

Then check the Run Script Automatically after Import option and click Update. Finally, save the template.

...It turns out that the script given above only works for single file imports. To make it work for single and multiple file imports you must precede it with %A=page.label$...

%A=page.label$;
for(i=1;i>0;i++) {
%F=%[%A,#i,\];
if(%F=="") break;
%L=%F;
};
page.label$=%L;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/30/2006 08:06:29 AM

Edited by - Mike Buess on 01/30/2006 4:27:19 PM
Go to Top of Page

winflowers

USA
34 Posts

Posted - 01/31/2006 :  04:46:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the code! It worked nicely at the beginning. But then I found if I unchecked the import option "Rename Worksheet to Data File Name", the code doesn't work anymore even with single ASCII import. It uses the last imported filename (last saved label) as the label.

In other words, if I don't check the import option "Rename Worksheet to Data File Name", the worksheet label will not be updated to the name of currently imported file. Is it true? Or I missed something?

Thanks!
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/31/2006 :  08:04:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The script I gave you requires that the wks label is already set to the file path\name. Apparently Origin does that only when it sets the wks name to file name. Unless you want both then there is no easy solution to your problem.

...If you use Origin 7.5 then this Worksheet script will work whether or not you name the wks after the file...

%A=page.info.system.import.filename$;
page.label$=%A;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/31/2006 08:21:37 AM
Go to Top of Page

winflowers

USA
34 Posts

Posted - 01/31/2006 :  2:54:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much for your assitant!
It helps me a lot.
This is really a great forum.
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