BookmarkSubscribe
Choose Language Hide Translation Bar
gallardet
Occasional Contributor

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 );

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
cwillden
Super User

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
5 REPLIES 5
vince_faller
Super User

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
Occasional Contributor

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/"

0 Kudos
cwillden
Super User

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
Occasional Contributor

Re: Set Current Directory

Eureka!

 

Thanks a lot!

0 Kudos
Highlighted

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" );
Learn it once, use it forever!