|
Home > Archive > Programming with dBASE > October 2005 > Re: Four (4) digit text file extension - dBASE 5.7 - Windows 2000
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Four (4) digit text file extension - dBASE 5.7 - Windows 2000
|
|
|
| B Betcher wrote:
> In article <MPG. 1db8b689a51a62879896
92@news.dbasetalk.com>,
> bbetcher@hot.rr.com says...
> I have the following to test
> 1. run myfile*.* /b > mylist.txt
> 2. use database filename, append from mylist.txt sdf
> 3. do while .not eof()
> memOldname = Filename
> memNewname = substr(filename,1,7)
+ '.' + substr(filename,9,3)
> run copy &memoldname &memNewname
> skip
> enddo
> Please let me know if you see a hazard in this code.
>
> Barbara B.
>
>
I see a possible major hazard as written. Are the extensions different,
or all the same?? If all the same, no problem. However, if they are
different, and the first part of the filename is the same, you may
duplicate names. IE barbara.0012, barbara.0013 would both rename as
barbara.001. Perhaps if you used substr(filename,10,3
) it would be
safer, unless the extentions used the first place as anything besides a
zero.
Glenn Fausel
| |
| Bruce Beacham 2005-10-17, 1:26 pm |
| Glenn wrote:
> B Betcher wrote:
[color=darkred]
Use "" in case you have spaces in the filenames.
Bruce Beacham
|
|
|
|
|