Subscribe Bookmark RSS Feed

why does not this word be executed

664786828

Community Trekker

Joined:

Jul 2, 2015

prefilepath=Set Default Directory( "C:\Users\Administrator\Desktop\新建文件夹\" );

filepath= Convert File Path( prefilepath, Windows );

filelists = Files In Directory(filepath);

lotfile="DFB-B2";

nf=N Items( filelists );

cctable= New Table( lotfile);//make an empty table

cctable<<New Column( "Source", Character, Nominal );

For( iii = 1, iii<= nf, iii++,

  filenow=(filelists[iii]);

         // If( Ends With( files, ".csv" ),

  dt= Open( filelists[iii] );

            dt<<new column("Source", Character, Nominal ) ;   

           :Source<<set each value(filenow);

            dt<<new column("lotNO", Character, Nominal ) ;

            :lotNO<<Set each value(Insert( substr(filenow,1,2),:ChipID));

  dt<<run formulas();

            cctable << Concatenate( Data Table( dt ), Append to first table );      

                  // Text Box( Regex( files, "(.+?)_", "\1" ) ) << journal; // All text before first "_" in file i's name is journaled

  close(dt,nosave);

          );

          

cctable<<save("C:\Users\Administrator\Desktop\新建文件夹 (2)\","Concatenated data.jmp");

who can tell me why the last line is invalid??

3 REPLIES
Craige_Hales

Staff

Joined:

Mar 21, 2013

cctable is a column.  dt is a data table.  <<save is a message for a data table.  try

dt << save("C:\Users\Administrator\Desktop\新建文件夹 (2)\","Concatenated data.jmp");

edit: it looks like the data table, dt, is closed inside the loop.  More changes may be needed.

Craige
664786828

Community Trekker

Joined:

Jul 2, 2015

cctable= New Table( lotfile);  //make an empty table 

i don't think  cctable is a column;


so there may be something else wrong?

Craige_Hales

Staff

Joined:

Mar 21, 2013

I did not read your code carefully, sorry.  What messages are in the Log Window?  I think the <<save( filename ) should look like this:

<< save("C:\Users\Administrator\Desktop\新建文件夹 (2)\" || "Concatenated data.jmp");


or


<< save("C:\Users\Administrator\Desktop\新建文件夹 (2)\Concatenated data.jmp");



Craige