Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to extract the parent folder of a file's path that i get from the context parameters (the path looks something like this c:\myFolder\File.csv, and i want to extract the c:\myFolder path) , so i can insert a file in the same folder as the one passed in parameters.
I want to use the File class of the java.io package so i can use the getParent() method to get the parent folder, the problem here is the import statement, for now i insert the import statement inside a tJavaRow component, but i can't use this method if my job does not have this component.
My question is this: is there a way to insert an Import Statement that'll be applied to my job without having to use a tJavaRow to add the java.io.File statement?
Best regards,
Ameen
To get the Path ,
Context.file = c:\myFolder\File.csv
String path = new java.io.File(Context.file).getParent();
To get the Path ,
Context.file = c:\myFolder\File.csv
String path = new java.io.File(Context.file).getParent();