BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Highlighted
Hegedus

Community Trekker

Joined:

Jun 23, 2011

Trouble Finding columns

Hi,

 

My goal is a script that loads all the csv files in a directory and then does name clean up.  Previously I had developed a script that worked on a single file and I am looking to expand it to batch loading.  I found a script on the board combining txt tables.jsl and added in the code so it works on the Mac and inserted my settings for the txt import.  That seems to work.

 

I am now working on the column clean up and this is the script.  It has trouble finding the "Column 3".  Up til then it executes.  Now the odd thing rhese lines were copied from my original script.

If I highlight the line with the column 3 rename in the new script and hit run (so only that line executes) I get an error.  If I highlight the same line in my original script and execute it works as intended.  I have literally copied and pasted (command-C and command-V) between the scripts.

 

What am I missing?

And yes Column 3 exists.

couln 3 exists.png

 

Andy

dt=current data table();

dt<<delete columns("Column 1");
dt<<delete columns("Column 2");
dt<<set table variable("Thickness",0.010);
dt<<set table variable("RotLen",0.16);
dt<<new column("meter",continuous,set formula(Row() * :RotLen));
//here is where it barfs.
name("Column 3")<<set name("Roller");
name("Column 4")<<set name("RawCen");
name("Column 5")<<set name("RawFar");
name("Column 6")<<set name("RawNear");
name("Column 7")<<set name("Center");
name("Column 8")<<set name("Far");
name("Column 9")<<set name("Near");
:Center<<set formula(:RawCen - :Thickness -:roller*0.50);
:Far<<set formula(:RawFar-:Thickness-:roller*0.25);
:Near<<set formula(:RawNear-:Thickness-:roller*0.75);
dt<<go to(:Far);
dt << Move Selected Columns( To first );
dt<<go to(:Near);
dt << Move Selected Columns( To first );
dt<<go to(:Center);
dt << Move Selected Columns( To first );
dt<<go to(:meter);
dt << Move Selected Columns( To first );
3 REPLIES 3
txnelson

Super User

Joined:

Jun 22, 2012

Re: Trouble Finding columns

There is a error with your use of Name().  This is a special syntax function.  It requires a ":" in front of the function,.......:Name()

Jim
Hegedus

Community Trekker

Joined:

Jun 23, 2011

Re: Trouble Finding columns

Thanks.

It is working.

Andy
Hegedus

Community Trekker

Joined:

Jun 23, 2011

Re: Trouble Finding columns

Though I am curious why if worked in my first script without the colons.

 

Andy