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
 Origin Forum
 importing data with fixed column limitation

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
leo_C Posted - 12/07/2007 : 08:39:49 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: xp

Hello again!
For some reason I couldnīt retrieve my password for this forum so I had to register again.

Well, I have some text data with fixed columns so that data is truncated between lines like in the example below. I wish to convert to Origin. Is there a procedure to automatically import, or is there an option to place an script to automatically do this dirty job? I use to import my files just by dragging and dropping them to Origin.
Thanks!

2.61 0.0 295.67001 0.20258 1.17542 1.1872 0.15276 -0.19521
-0.00062 0.0008 0.00549
0.574 0.0 296.23801 0.20277 1.17636 0.96822 0.13412 -0.13448
-0.00154 0.00138 0.008
-1.513 0.0 296.85901 0.20298 1.17744 0.7135 0.11885 -0.06976

2   L A T E S T    R E P L I E S    (Newest First)
leo_C Posted - 12/18/2007 : 4:02:39 PM
Thanks, Mike!

I will try this after Iīm back from my vacations :D

I plan to modify this script for a n number of "extra" columns also, maybe it would be useful too

regards


Mike Buess Posted - 12/07/2007 : 12:57:33 PM
Seems to me you want to move even rows up to the end of the previous row...

before:
2.61 0.0 295.67001 0.20258 1.17542 1.1872 0.15276 -0.19521
-0.00062 0.0008 0.00549
0.574 0.0 296.23801 0.20277 1.17636 0.96822 0.13412 -0.13448
-0.00154 0.00138 0.008


after:
2.61 0.0 295.67001 0.20258 1.17542 1.1872 0.15276 -0.19521 -0.00062 0.0008 0.00549
0.574 0.0 296.23801 0.20277 1.17636 0.96822 0.13412 -0.13448 -0.00154 0.00138 0.008


If I'm wrong then please explain. Otherwise you can use the script below. If you use Import ASCII then save it as the Worksheet Script (Tools> Worksheet Script) for your worksheet template and set Run Script Automatically after: Import. If you use a filter save the script under its Advanced filter options.

rr=wks.maxrows; // current number of rows
cc=wks.ncols; // current number of columns
work -a 3; // add 3 columns
for(i=1;i<=rr/2;i++)
{
work -s 1 (i+1) 3 (i+1); // select first 3 columns of next row
menu -e 57634; // execute Edit> Copy
work -s (cc+1) i (cc+3) i; // select last 3 columns of this row
menu -e 57637; // execute Edit> Paste
mark -d col(1) -b (i+1) -e (i+1); // delete next row
};

Mike Buess
Origin WebRing Member

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