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
 Import Wizard - seperator problems

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
Bladilu Posted - 10/29/2010 : 05:03:28 AM
Origin Ver. 8.1 and Service Release SR1 Operating System:XP

Hi Guys ,

iam having Problems importing some .txt Date into Origin .
The Data looks like that :
##Temp./°C,E'/MPa(50.00Hz),E'/MPa(20.00Hz),E'/MPa(10.00Hz),E'/MPa(5.00Hz),E'/MPa(2.00Hz),E'/MPa(1.00Hz),tand(50.00Hz),tand(20.00Hz),tand(10.00Hz),tand(5.00Hz),tand(2.00Hz),tand(1.00Hz) 
 -40,00000  ;  1794,12671;  1774,58948;  1756,88953;  1739,56030;  1720,39282;  1707,24609; 6,34108E-02; 5,43609E-02; 4,49786E-02; 4,38529E-02; 4,23635E-02; 4,19082E-02


My problem is ,that i can choose only one seperator in the wizard,
but the seperators for the longname and the values are different.

Regards Bladilu
4   L A T E S T    R E P L I E S    (Newest First)
eparent Posted - 11/16/2010 : 11:25:35 AM
Here is the script code again, but this time I have added comments to explain the purpose of each line. If something is still not clear please let me know.


// Copy Long name from column 1 to a local string variable.
string names$ = col(1)[L]$; // 1=col index, L=Long name row

// Use 'c' for our column index, init to 1 (first col).
int c = 1;

// Use 'delim' for comma positions, init to index of first comma.
int delim = names.Find(",");

// Keep looping as long as we find a comma.
for (;delim > 0;)
{
    // Set column's Long name to part of string before the comma.
    col($(c))[L]$ = names.Left(delim - 1)$;

    // Increment column index.
    c++;

    // Delete the part of string before and including the comma.
    names.Delete(1, delim);

    // Find the next comma in the remaining string.
    delim = names.Find(",");
}

// Whatever remains in the string is the last long name.
col($(c))[L]$ = names$;

// Call the 'wcolwidth' X-Function to resize all the columns
// so they are wide enough to read their long names.
wcolwidth irng:=1! width:=10;
Bladilu Posted - 11/16/2010 : 03:50:55 AM
Hi its me again ,

i realized that this seperator problem ocurs realy often .
Could someone explain this script which eparent posted?

thx
Bladilu Posted - 11/02/2010 : 11:16:29 AM
Thx eparent , worked fine !
eparent Posted - 10/29/2010 : 3:14:19 PM
The Import Wizard does not support the ability to specify unique delimiters at that level. You can however choose ';' as your delimiter which will import the data correctly and put the entire long name row into the first column's Long Name. Then, in the filter's post script you can use the following code to parse the imported long name row and set the long names for all your imported columns.

string names$ = col(1)[L]$;
int c = 1;
int delim = names.Find(",");
for (;delim > 0;)
{
    col($(c))[L]$ = names.Left(delim - 1)$;
    c++;
    names.Delete(1, delim);
    delim = names.Find(",");
}
col($(c))[L]$ = names$;
wcolwidth irng:=1! width:=10;

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