 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Shawn Martin
Joined: 15 Nov 2004 Posts: 15
|
|
FileReplaceEx |
|
I used sample code found in the message board to change a comma separated file to a tab delimited file, Example script to replace commas with tabs: Dim count_changes, number FileReplaceEx "my file name her", ",", "\t", false, count_changes When the job runs I do not get an error, but nothing changes in the file the file. What am I missing?
|
|
Mon Jan 10, 2005 10:24 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: FileReplaceEx |
|
Most likely specified file name is incorrect. Make sure you specify full file name including path and you use double backslashes for example FileReplaceEx "c:\\temp\\test.txt", ",", "\t", false, count_changes : I used sample code found in the message board to : change a comma separated file to a tab delimited file, : Example script to replace commas with tabs: Dim count_changes, number : FileReplaceEx "my file name her", ",", "\t", : false, count_changes : When the job runs I do not get an error, but nothing changes in the file : the file. What am I missing?
|
|
Mon Jan 10, 2005 10:51 pm |
|
 |
Shawn Martin
Joined: 15 Nov 2004 Posts: 15
|
|
Re: FileReplaceEx |
|
: Most likely specified file name is incorrect. Make sure you specify full file : name including path and you use double backslashes for example : FileReplaceEx "c:\\temp\\test.txt", ",", "\t", : false, count_changes The filename works. I was trying to use a UNC, but that didn't work. I changed the path to the drive letter and the FileReplaceEX worked. However, when I try to do the databaseImport I still get the error message "not a tab-separated file". When I look at the file, the commas are replaced by the /t. I have also tried inserting " " in place of the commas. That does not work either. Any suggestions?
|
|
Tue Jan 11, 2005 9:19 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: FileReplaceEx |
|
It should work with UNC. I bet you forgot about special ASCII characters handling in JAL. Enter your UNC path as \\\\server\\share\\dir\\file or change deafult escape character \ to something else. Also, it is not /t it is \t. You can also enter actual tab charcater instead of entering it as a special code \t. Please see "special ASCII characters" topic in the on-line help for more info. : The filename works. I was trying to use a UNC, but that didn't work. I : changed the path : to the drive letter and the FileReplaceEX worked. However, when I try to do : the databaseImport : I still get the error message "not a tab-separated file". When I : look at the file, the commas : are replaced by the /t. I have also tried inserting " " in place of : the commas. That does not : work either. Any suggestions?
|
|
Tue Jan 11, 2005 11:29 am |
|
 |
Shawn Martin
Joined: 15 Nov 2004 Posts: 15
|
|
Re: FileReplaceEx |
|
: It should work with UNC. I bet you forgot about special ASCII characters : handling in JAL. : Enter your UNC path as \\\\server\\share\\dir\\file or change deafult escape : character \ to something else. : Also, it is not /t it is \t. You can also enter actual tab charcater instead : of entering it as a special code \t. Please see "special ASCII : characters" topic in the on-line help for more info. I'm sorry, I did use \t. I had mis-typed it in my comment below, and the UNC does not work. I did use '\\\\', and I have read the special characters sections of the help documentation. The code is still not working.
|
|
Tue Jan 11, 2005 4:02 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: FileReplaceEx |
|
Do you have "\" selected as an escape character in Tools/Options menu, Editor tab page? When you run this script in the debugger does the path look ok? : I'm sorry, I did use \t. I had mis-typed it in my comment below, and the UNC : does not : work. I did use '\\\\', and I have read the special characters sections : of the help documentation. The code is still not working.
|
|
Tue Jan 11, 2005 5:04 pm |
|
 |
Shawn Martin
Joined: 15 Nov 2004 Posts: 15
|
|
Re: FileReplaceEx |
|
: Do you have "\" selected as an escape character in Tools/Options : menu, Editor tab page? : When you run this script in the debugger does the path look ok? Path is correct, and the tabs are in the file. Still DatabaseImport fails.
|
|
Tue Jan 11, 2005 9:51 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7969
|
|
Re: FileReplaceEx |
|
We were talking about FileReplaceEx and UNC issue all day, that is why I asked to check system options. Now you are talking about about DatabaseImport. Does it mean that yuo got FileReplaceEx working? Regarding the DatabaseImport issue, which error is reported in the job log? : Path is correct, and the tabs are in the file. Still DatabaseImport : fails.
|
|
Tue Jan 11, 2005 10:26 pm |
|
 |
Shawn Martin
Joined: 15 Nov 2004 Posts: 15
|
|
Re: FileReplaceEx |
|
: I used sample code found in the message board to : change a comma separated file to a tab delimited file, : Example script to replace commas with tabs: Dim count_changes, number : FileReplaceEx "my file name her", ",", "\t", : false, count_changes : When the job runs I do not get an error, but nothing changes in the file : the file. What am I missing? I'm sorry, you're right. Yes, I set my options for the special characters, and that worked. I am using drive letters b/c the UNC did not work, but I am not getting a 'file not found error'. I now have a databaseimport error. I will start a new issue on that. Thanks.
|
|
Wed Jan 12, 2005 7:47 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|