theninjamanz 29 Posted April 23, 2012 Report Share Posted April 23, 2012 I have used the $Get Files command to pull back a list of file names from a folder. What I am trying to do is add the content of a single file contained in the folder to a list. However, the following code returns the error "illegal characters in path". However the $read file is fine. add item to list(%article titles, $get files("{$special folder("Application")}\\articles\\{#project name}\\", "No"), "Delete", "Global")set(#current article, $next list item(%article titles), "Global")add item to list(%current article content, $read file("{$special folder("Application")}\\articles\\{#project name}\\{#current article}"), "Delete", "Global") Thanks for any help. Quote Link to post Share on other sites
Legend 181 Posted April 23, 2012 Report Share Posted April 23, 2012 That error will return when you have characters like ? [ ] / \ = + < > : ; " , * | in your filenames... Quote Link to post Share on other sites
theninjamanz 29 Posted April 23, 2012 Author Report Share Posted April 23, 2012 Yes, that is what I thought, and I don't have any of there: If I spell out the fields $specialfolder (is the application folder) \ articles (is the folder) \ #project name (is the projectname set at the UI and is also the name of the folder where the articles are stored) \ #current article (is $next list item on a previously scraped $getfiles - Include path no). So in theory where I have a folder called myfirstproject and two files 1.txt and 2.txt I should get the following output from my Add item to list: Application\articles\myfirstproject\1.txt But instead I get a $read file error. Is there a problem adding stuff to lists using the $read file command? Quote Link to post Share on other sites
theninjamanz 29 Posted April 24, 2012 Author Report Share Posted April 24, 2012 Yes, that is what I thought, and I don't have any of there: If I spell out the fields $specialfolder (is the application folder) \ articles (is the folder) \ #project name (is the projectname set at the UI and is also the name of the folder where the articles are stored) \ #current article (is $next list item on a previously scraped $getfiles - Include path no). So in theory where I have a folder called myfirstproject and two files 1.txt and 2.txt I should get the following output from my Add item to list: Application\articles\myfirstproject\1.txt But instead I get a $read file error. Is there a problem adding stuff to lists using the $read file command? Up anyone can help? Quote Link to post Share on other sites
xenergy 3 Posted December 3, 2013 Report Share Posted December 3, 2013 It might be late to post a comment on this thread, but just in case other people having the same issue.So I found out that you must save your file in ANSI encoding if you want to use file's content for directory path usage. Somehow a strange invisible characters (?) appears on the very first part of the file content when you read a UTF-8 encoded it using $read file or $list from file functions. You can only see this characters using notepad++ with "Show all characters" option on. This will not be appear in other text editor (i.e. notepad). I'm not sure if this is a bug, of a expected behavior for UTF-8 encoded file. Hope it helps. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.