Solved

When using the Directory and File Pathways reader on a unc path with a space in the path name I'm unable to get the full path once it's written to a csv.

  • 5 January 2022
  • 6 replies
  • 25 views

Badge

Hello,

 

FME Desktop 2019.2.3.3 Build 19825 Win64

 

I'm getting a few issues when using the Directory and File Pathways reader to get the subfolds in a directory.

 

I have a Published Parameter that is set up for File_Path input. If I put a path with a space in the name I'm able to see all subfolders when running in FME Desktop, but once I write to csv the file paths are truncated to only show the path up to the first space.

Example:

 In FME Desktop I see this: \\\\unc_path\\a\\b\\a b c

FME Visual Preview 

Here's what the csv output looks like: \\\\unc_path\\a\\b\\a

 

CSV Results 

That led me to try and add double quotes "" "" around the path in the Published Parameter which then gets to my second issue that it then adds commas "," into the path where the spaces are.

 

Added Commas 

We'd like this workbench to be dynamic and allow any file path whether there's a space or not. Is there a solution that doesn't require my end users to change the file path to forward slashes, double quotes, etc.?

I was thinking a Startup Python Script might be a solution but wanted to get further input.

 

Please see images for more information.

Thanks

icon

Best answer by jr2 7 January 2022, 20:45

View original

6 replies

Badge +4

Hi @ngstoke​ ,

 

Does your folder path in the CSV need to be identical to the input one? I'm wondering if you could just use a StringReplacer to replace spaces with underscores, or something like that. Of course, then if you have it set up as a link in the CSV this wouldn't work.

Badge

Hi @ngstoke​ ,

 

Does your folder path in the CSV need to be identical to the input one? I'm wondering if you could just use a StringReplacer to replace spaces with underscores, or something like that. Of course, then if you have it set up as a link in the CSV this wouldn't work.

Hey @drc43​,

 

Thanks for the suggestion but I'd prefer not to go that route because the end user needs to know the exact path and be able to navigate there with this document.

Badge +4

Hey @drc43​,

 

Thanks for the suggestion but I'd prefer not to go that route because the end user needs to know the exact path and be able to navigate there with this document.

I wondered if that would be the case.

Not sure if upgrading is an option, but just so you know, this issue is fixed in v2020.2 Build 20787.

Badge

Hey @drc43​,

 

Thanks for the suggestion but I'd prefer not to go that route because the end user needs to know the exact path and be able to navigate there with this document.

We're hoping to eventually put this onto our FME Server, but are on 2019 there too and the upgrade isn't currently planned until later in the year. I do appreciate the ideas though. Thank you @drc43​!

I am having difficulty reproducing your problem. I’m using the FME 2019.1.1.0 version and with a PATH reader (unc path) and a csv for writer. However my unc path has a lot of space. Everything works fine as long as the unc path is in quotes ex: "\\\\ server \\ test with space \\ another space \\ etc"

 

If you have commas in your unc path ex: "\\\\ server \\ test, with, space \\ another, space \\ etc" it is certain that in your csv you will have an unwanted value.

 

You should change the separator in the writer to " | " (a value impossible to find in a path)

image 

Badge

I am having difficulty reproducing your problem. I’m using the FME 2019.1.1.0 version and with a PATH reader (unc path) and a csv for writer. However my unc path has a lot of space. Everything works fine as long as the unc path is in quotes ex: "\\\\ server \\ test with space \\ another space \\ etc"

 

If you have commas in your unc path ex: "\\\\ server \\ test, with, space \\ another, space \\ etc" it is certain that in your csv you will have an unwanted value.

 

You should change the separator in the writer to " | " (a value impossible to find in a path)

image 

Thanks @jr2​!

 

I took another look at the log file on the csv output and I believe it's the special characters in certain file path that's giving me the issues. I switched it to a xlsx writer and this appears to of fixed my issue.

Reply