Skip to main content
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.

  • January 5, 2022
  • 6 replies
  • 212 views

ngstoke
Contributor
Forum|alt.badge.img+1

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

Best answer by jr2

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 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

drc43
Contributor
Forum|alt.badge.img+12
  • Contributor
  • January 5, 2022

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.


ngstoke
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • January 5, 2022

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.


drc43
Contributor
Forum|alt.badge.img+12
  • Contributor
  • January 5, 2022

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.


ngstoke
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • January 5, 2022

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​!


jr2
Contributor
Forum|alt.badge.img
  • Contributor
  • Best Answer
  • January 7, 2022

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 


ngstoke
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • January 10, 2022

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.