cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
alan_h
Level I

How do I use a relative folder path in multiple file import?

Members of my group use a Sharepoint workspace that includes raw test data that we'd like to import and process in JMP. Our shared script for processing that data is stored within the Sharepoint workspace itself, which seems to present problems for defining the folder path for the multiple file import function. It seems that Microsoft defines the path for a mounted Sharepoint or OneDrive folder as if it's located within the C-drive, under your user ID folder. So every user who wants to use this script needs to edit the folder path to replace userid1 below with their respective ID before running the script. Small annoyance, but seems like it should be fixable. If there a way to define the folder path as "currentdirectory\Incoming data\", where currentdirectory is the location of the script itself?

 

Multiple File Import(
	<<Set Folder(
		"C:\Users\userid1\OneDrive - CompanyName\Documents - SharepointGroupName\E-test\Incoming data\"

JMP version 16.0, if that matters.

3 REPLIES 3

Re: How do I use a relative folder path in multiple file import?

This issue has come up in the past. You might search for other questions about opening files in SharePoint or OneDrive.

 

JMP sets a path when you open a file (the script) using File > Open. I do not know if it works this way if you double-click the file. You can get the path by calling Get Current Directory().

 

You might find path variables helpful. You can define your own, too.

alan_h
Level I

Re: How do I use a relative folder path in multiple file import?

Hi Mark,

 

Thanks for the reply. I wasn't able to find any previous posts that quite captured my issue, but I was able to assemble something that worked using the pieces you mentioned. Interestingly, I found that Get Current Directory() always pointed to my "Documents" folder within OneDrive, rather than the path of any recently opened file. That ended up working out okay, though - I was able to simply parse the beginning of that path using a Left() function to pick up the userid portion and concatenate the Sharepoint piece onto it.

 

Thanks for the help!

 

 

Multiple File Import(
	<<Set Folder( Left(Get Current Directory(),41)||"Documents - SharepointGroupName\E-test\Incoming data\" ),

 

 

jthi
Super User

Re: How do I use a relative folder path in multiple file import?

Convert File Path(path, <"Absolute"|"Relative">, <"POSIX"|"Windows">, <Base(path)>, <Search>) might also be sometimes useful when working with paths.

Also you can use

Get Environment Variable("username");

to get current users username

-Jarmo