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 for Programming
 LabTalk Forum
 Save the columns of a imported file into datasets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jvpiera

Spain
Posts

Posted - 10/16/2006 :  03:28:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 5.0
Operating System: windows xp

Hi,

I tried to assign the name of a file column saved in a string to a dataset but it doesn't work.

getfile *.ASC; // %A contain the name of the file.
%P=%[%A,'.'];
%P=%P_B; // Now %P contain FileName_B without the
// extension ASC.
create A50_D 651; // I created a new dataset.
for (i=0;i<652;i++)
{
A50_D=(%P); // This doesn't work.
}

[i]
[i]

Mike Buess

USA
3037 Posts

Posted - 10/16/2006 :  07:55:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The create command creates numeric datasets and there is no way change the format of a hidden dataset. Try this instead...

getfile *.ASC;
%P=%[%A,'.'];
%P=%P_B;
win -t D; // create new worksheet
wks.col2.name$=D; // change name of column 2 to D
wks.col2.format=2; // change format of column 2 to text
set %H -er 651; // create 651 rows
win -r %H A50; // change wks name to A50
loop(i,1,651)
{
A50_D[i]$=%P; // set row i of col D to %P
};

Mike Buess
Origin WebRing Member
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