cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
gallardet
Level III

Set Current Directory

Hi. 

I have written some sentences to set the current directory where to find the files of interest but it dones not work. Any help? Thanks

 

 

Set Current Directory( "/Users/manel/Desktop/Municipales_Spain" );

my_file = Pick File( {"All files|*"} );

dt = Open( my_file );

dt << Select Where(
	Código de Provincia == 44
);

SubDt = dt << Subset( output table name( "Matarranya1" ) );

Close( "Matarranya1", Save( "/Users/manel/Desktop/Municipales Spain/04_1995Terol.jmp" ) );

Close All( Data Tables, No Save );

 

1 ACCEPTED SOLUTION

Accepted Solutions
cwillden
Super User (Alumni)

Re: Set Current Directory

Would this do what you need?

path = "/Users/manel/Desktop/Municipales_Spain";

my_file = Pick File( "", path, {"All files|*"} );

dt = Open( my_file );

dt << Select Where(
	Código de Provincia == 44
);

SubDt = dt << Subset( output table name( "Matarranya1" ) );

Close( "Matarranya1", Save( path||"/04_1995Terol.jmp" ) );

Close All( Data Tables, No Save );
-- Cameron Willden

View solution in original post

5 REPLIES 5
vince_faller
Super User (Alumni)

Re: Set Current Directory

The scripting index (Help>>Scripting Index) doesn't say there's anything called set current directory().  Are you looking for 

Set File Search Path(
	{Convert File Path( "$SAMPLE_DATA/" ), Convert File Path( "$SAMPLE_DATA/Time Series/" )}
)
Vince Faller - Predictum
gallardet
Level III

Re: Set Current Directory

Hi Vince, I try your proposal but I can't change the directory.

 

Set File Search Path( {Convert File Path( "/Users/manel/Desktop/ELECCIONS/JMP coses/Scipts/" ), Convert File Path( "/Users/manel/Desktop/Municipales_Spain/" )} );

 

When I ask about the  Default Directory();

I get:

"/Users/manel/Desktop/ELECCIONS/JMP coses/Scipts/"

cwillden
Super User (Alumni)

Re: Set Current Directory

Would this do what you need?

path = "/Users/manel/Desktop/Municipales_Spain";

my_file = Pick File( "", path, {"All files|*"} );

dt = Open( my_file );

dt << Select Where(
	Código de Provincia == 44
);

SubDt = dt << Subset( output table name( "Matarranya1" ) );

Close( "Matarranya1", Save( path||"/04_1995Terol.jmp" ) );

Close All( Data Tables, No Save );
-- Cameron Willden
gallardet
Level III

Re: Set Current Directory

Eureka!

 

Thanks a lot!

Re: Set Current Directory

Just to add to the other responses, you should not use the Set Current Directory() function. It has been deprecated because of bad behavior. The correct function to use is Set Default Directory().

 

Names Default To Here( 1 );
Set Default Directory( "$SAMPLE_DATA" );
Open( "Big Class.jmp" );