I have a task to split a single file into two separate files which I have done. However, afterward I need to move the source file from the source directory into an Archive folder so it does not get picked up again the next day.
The file name is quite bad, something like "DFG.AE234125.HDS932.H001.U001", but is out of my control to rename as we receive the file like that from external. My loop works fine in the sense that it picks up all files and splits them as it should by iterating using a User::SelectedFile variable. When it reaches the newly added "move file to archive" script task it gets stuck in loading for almost a full minute and returns error like "Filename cannot contain character like '/\=,.'" Script is in C# and it declaring two strings one for the archive path and the other for the file name and uses the User::SelectedFile variable.
Things I have considered/tried:
- Checking the file paths (they are correct as I am using a test directory on my C Drive as I do not have access to the server location)
- As I am using local location it can't be a permission problem especially as it is picking up the file for the split.
- This is a standalone process that uses flat file connections, so there is not server connection issue.
- I have also tried using File System Task for this but get the same error for the name.
- The C# script itself is copy&pasted from another package that needs to move the processed file to an archive folder. It works there. All I have done in the new script is changing the variables for the path.
- I have added breakpoints and can see that the variables have the correct values when they reach the script task.
The issue seems to be at the point where the process lands at the script task. At this point the split has already been done successfully. Can someone advise on a workaround to ignore the "."s in the filename so I can move the damn thing to the archive folder?
This is my first post on Stackoverflow so any feedback on the post itself is welcome.
Many thanks in advance.
IP