Illeg&l Ch&rachters
How do you guys handle files with funny characters in them please?
My fail point is when I inject. First there is an error that the file does not exist, followed by a later error that my xml is now orphaned.
The issue each time is a funny character, like an "&" in the file name.
How do you handle Illegal Characters?
Re: How do you handle Illegal Characters?
Here is a script that scrubs them from private data variables: https://github.com/open-automation/swit ... e-scrubber
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Re: How do you handle Illegal Characters?
Thanks
Your forum posts and scripts are very clear and useful. I could not get by without your private data script! I use that all the time for sorting jobs.
I'm a bit unclear how I use this for injecting a job with an "&" in the filename
Example error I'm trying to work around
Your forum posts and scripts are very clear and useful. I could not get by without your private data script! I use that all the time for sorting jobs.
I'm a bit unclear how I use this for injecting a job with an "&" in the filename
Example error I'm trying to work around
Code: Select all
Error,Inject job,141032.01.xml,Failed to inject job: file or folder 'foo\141032.01\A5 SPEND&SAVE - final.pdf' does not exist
Re: How do you handle Illegal Characters?
If the problematic characters are in the filename and Switch has problem finding the files Switch can't change the file name until the file is in the Switch system.
What are the file systems? Are the files on another system than the Switch installation?
Jan
What are the file systems? Are the files on another system than the Switch installation?
Jan
Re: How do you handle Illegal Characters?
Thanks,
Very good point that Switch can't work on files it can't find.. I feel silly for even considering that!
The files are on a Windows Server which I access over the network.
I suppose I was wondering whether I could manipulate the XML or pull the path into Private Data (as Gabriel seemed to be suggesting) then clean it up and try my Inject.
Switch is saying
I guess Gabriel is saying to pull the file path into a Private Data key, clean it, then call the Inject with the clean path - but I'm at loss to how.
Very good point that Switch can't work on files it can't find.. I feel silly for even considering that!
The files are on a Windows Server which I access over the network.
I suppose I was wondering whether I could manipulate the XML or pull the path into Private Data (as Gabriel seemed to be suggesting) then clean it up and try my Inject.
Switch is saying
Code: Select all
Failed to inject job: foo/bar&baz.pdf' does not exist
Re: How do you handle Illegal Characters?
I would probably aim to figure out how the files are getting there in the first place, then have Switch do that, cleaning the file names before I archive them. Then later on, they can be injected more easily.cwswitch wrote: I guess Gabriel is saying to pull the file path into a Private Data key, clean it, then call the Inject with the clean path - but I'm at loss to how.
Code: Select all
Failed to inject job: foo/bar&baz.pdf' does not exist
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Re: How do you handle Illegal Characters?
Shouldn't Switch decode the XML, the & is illegal in XML and is written as &. If you get it from a Metadata variable it should be correctly applied as a file path in Switch. If not you always have the Search field in the variables were you can do a RegEx to change the & to & and then the path should work.
Jan
Jan