Function to convert relative path to full path

Hi,

Is there a function to convert a relative path to a full path ?

Thanks
Nikolaas

Yes, see the combinepath() function.

Hi Dmitry,

I have checked it :slight_smile:.

For example: if I have a relative path “…/…/mydata”, how can I use combine path to derive the absolute path?

Something like this ? In my case it gave not the right result so maybe I am using it in the wrong manner?

combinepath( “…/…/mydata”, ‘’)

What absolute path are you expecting to get?

Hi Dmitry,

I have a parameter that contains a relative path. I have to pass the absolute path to a powershell command. So I would like to calculate the absolute path of the parameter value and save it in a separate calculated parameter.

Any Idea how I can do that ? I need the relative path in de first parameter because I have to run the ETL on the server, so I always use relative paths.

Thanks !
Nikolaas

A relative path is always relative to some absolute path. So you need to combine a relative path with some absolute path in order to produce another absolute path.

Below you don't provide any base absolute path, but you should (as the 1st argument). The relative path should be the 2nd argument. Then the result will be an absolute path calculated from an absolute path and a relative path.

Ok thanks. I have solved it like that for now but I thought maybe there would be a function that could derive the absolute path.

Say for example that the morph file is located in project/ETL/mymorph.morph.
In that project we have a relative path parameter: my_param = …/DATA/mydata.csv

Is there no function available that could automatically convert …/DATA/mydata.csv to project/DATA/mydata.csv without having to pass the first piece “project” of the absolute path in the combinepath() function?

  • project
    • ETL
    • DATA

There is an absolute path of that file, you should use that as the base for a relative path.

FYI - inside a project you can obtain the absolute path to the current project using the system() function.

Ok I get it.

Thanks for the suggestion !