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
 Ascii inport get too many lines as header
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gavin.read

UK
15 Posts

Posted - 12/16/2002 :  11:18:38 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi All,

I'm writing a script to import a series of csv files - shouldn't be a problem eh?

However, if I just import them with "open -w etc.", no problems the files import as I expect with a one line header which sometimes is placed in the column label area since the individual column headings are too long. No problem there either. If I then add the necessary commands to plot a dataset from each worksheet and run it, the import gets messed up, with one or two lines getting mixed up with the column labels, and the column label which was too long to become a column name now becomes a column name.

I imported the files using a template worksheet and so I have explicitly set the import characterisitcs. Can anyone tell me what is going on?

I am using Origin 6.0 on WinNT

cheers,

Gav.

gavin.read

UK
15 Posts

Posted - 12/17/2002 :  06:04:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Things are even stanger;

If I import the worksheets and do nothing else, everything is OK.

However if I then try to plot them using a Labtalk script I find that the column label (on the worksheet) is shifted up a level i.e. it appears in the column name field of the column. When I double click on it I find that the column label remains abut the column name has disappeared.

Any clues?

Gav.

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/17/2002 :  08:04:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Gav,

What happens if you plot the data manually (using the Plot menu)? If your plotting script's not too long why don't you post it here.

Mike Buess
Origin WebRing Member
Go to Top of Page

gavin.read

UK
15 Posts

Posted - 12/17/2002 :  10:25:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Well I've shortened the column names in my CSV so they get imported directly into the column name.

Now when I use this script, the column name disappears entirely in all worksheets and the plot that's is left has nothing on it. Any ideas? This is beginning to get on my nerves. Anyway here is my script.

win -c %H; //delete the active blank worksheet

win -n PLOT StepCH; //Open a plot window

%P = %H; // Save it's name for future use

for(ii = 1; ii <= 10; ii+=1) { //Number of csv files

%z = charge$(ii).csv; //make filename on the fly

win -t DATA cvsimport; //Open a wks template for the import

open -w c:\DIR\%z; //Import file

%H!wks.col1.type = 4; //Ensure first column is x

%J = %H; //Save wks name for future

%H = %P; //Make plot window active

lay -i %J_M02.V; //Lay the dataset in the plot

}

As you can see this script is a bit "belt and braces".




Go to Top of Page

gavin.read

UK
15 Posts

Posted - 12/17/2002 :  10:26:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
P.S. when I import them in using the script and then plot them manually there is no problem - apart from the one in which I can't plot them automatically.

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/17/2002 :  3:29:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Gav,

One definite problem with your script is that you cannot activate the window %P with "%H=%P". (Try it in the script window.) The subsequent layer command operates on the worksheet %J, no doubt resulting in the wierd events you are seeing. Replace "%H=%P" with "win -a %P" and see if that fixes things.

Mike Buess
Origin WebRing Member
Go to Top of Page

gavin.read

UK
15 Posts

Posted - 12/18/2002 :  03:37:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike,

That worked a treat.

Gav.

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