Non-English Characters in folder names are causing errors
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Background: I have created a workflow that copies files in one directory (and sub directories) to another directory based on specific characteristics. This workflow has undergone a lot of testing by myself and I have not encountered any errors. (Current size at this point: 1 directory, 2 sub directories, all English characters)
Problem: I have tried to upscale this workflow to include 1 directory with over 3000 sub directories within and it failed. After troubleshooting, I found that it failed because there were non-English characters within some folder names.
Question: Is there a way to get Alteryx to read these folder names with the non-English characters? I was thinking to do some sort of subsitution/replacement within Alteryx, but I feel like that would change the file path that it looks for (and therefore would not be able to pick up what I want it to).
Thank you in advance for your help.
Update:
I have been troubleshooting for most of the last day. For more context, I run a workflow to use Windows Command at the end of it. The workflow (as stated) works, meaning the formulas are not an issue. I tried to use my copy formula (which is the last step) in Windows Command manually, using the directory that contains the non-English character and this worked. It is only when I try and do it within Alteryx that it does not work, so it definitely seems like it is something with Alteryx when it tries to use the .bat file to copy. I have tried changing the output in the run tool to different formats and code pages (e.g Unicode UTF-8 (same problem, Unicode UTF-16 (did not work at all).
I opened up the Windows Command manually after running the workflow and the Non-English Character is not written properly (see picture, it is meant to be a À, but is actually a weird L looking thing). There is meant to be 90 files copied over, but as you can see, it says 0 (because the directory with the weird L does not exist)
Solved! Go to Solution.
- Labels:
- Batch Macro
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @thrnma
You can use the function ConvertToCodePage([FieldName],20127) to convert ábç to abc, etc. See the following post..
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Error-when-running-MACRO/td-p/543167
Hope that helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am curious how you've built your workflow? Did you use the directory tool? I think you may have found something Alteryx needs to look into. I created a folder on my desktop and named it "這是一個文件夾" and then I created a file in that folder named "這是一個文件.txt" and the directory tool wasn't able to read it in!
I know there is support for other languages like japanese so I wonder how it's being done there?
Now if I just use the input tool that seems to work....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
Thank you for this, it is useful for me in another aspect. The issue with it for my case in this thread is that it changes the file path name and therefore cannot find it as the converted file path name does not exist in my directory.
I feel like I am going to need to manually change the folder names in order to get Alteryx to accept the whole file path.
Thank you for your help and the link to the other post though!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am using the directory tool. The issue here for me is that there are multiple languages being used. I found a post here: https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-To-resolve-errors-in-Designer-f...
which uses the input tool and converts the language that way. But as you may have encountered, there is no way to do that on the directory tool (that I can see). When I change the actual directory (in windows explorer) to include an A instead of À (where this is the only non-English character) then Alteryx reads it in perfectly, so it does just seem to be an issue of Alteryx not being able to read it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@MarqueeCrew have you encountered this before?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The special character used in the file path (À) is supported by the ISO 8859-1 Latin I Code page which is what you use in the RunCommand module when generating your .bat file. Despite the file being generated correctly, the actual command line doesn't recognise the character.
After some digging it became apparent that this is due to the DOS code page setting rather than the file code page. English version runs under code page 850 by default and doesn't support the special character. Forcing the code page to 1252 (French one) will fix the issue for you.
Please use the below command to change the code page on the the fly before executing your copy command
chcp 1252
Thanks @JoeS!
