Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing special Characters from string

Status
Not open for further replies.

davec99

Programmer
Jun 20, 2002
3
CA
I'm using microsoft access to create a batch file to rename a folder of files. Some of the file names are french. example Rúben however dos or windows corrupts the file and cannot be used.

Can I strip these characters in access.

Thanks in advance.
 
Try the 'Left, Right, InStr' Functions, some very useful samples are here:


Unfortunately, I don't know how to get around using Windows Character Map to specify foreign characters. Installing additional languages using the Control Panel\Keyboard\Language setting works for Word, but I never used it in Access. It may be worth giving it a shot unless you have a better option available.

You're not alone,

TomCologne
 
Hmmmmmmm,

Why?

Creating a batch file to rename a folder (directory)?

Seems a bit like going all the way around the barn to me.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I'm renaming the files in the directory not the directory itself.
 
still, WHY? Only a different path to (STILL) go all the way around the barn. Which part of NAME is inappropiate to your needs - but acceptable to DOS?

DIRECTLY from HELP:
Name Statement


Renames a disk file, directory, or folder.

Syntax

Name oldpathname As newpathname

The Name statement syntax has these parts:

Part Description
oldpathname Required. String expression that specifies the existing file name and location — may include directory or folder, and drive.
newpathname Required. String expression that specifies the new file name and location — may include directory or folder, and drive. The file name specified by newpathname can't already exist.



Remarks

The Name statement renames a file and moves it to a different directory or folder, if necessary. Name can move a file across drives, but it can only rename an existing directory or folder when both newpathname and oldpathname are located on the same drive. Name cannot create a new file, directory, or folder.

Using Name on an open file produces an error. You must close an open file before renaming it. Name arguments cannot include multiple-character (*) and single-character (?) wildcards.
MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I'm new at this so i might not be doing this the most efficient way.
Here is a more detailed example of what I am trying to accomplish.
I have a folder of jpg images named sequentially 1-500 but I need these images named with the person's name. Some of the names are french it is only those names I am having a problem with.
I need to be able to substitute u instead of ú because windows is striping these characters and making the file unusable.
 
Hmmmmmmmmmmm,

Still back a the (WHY) ranch. Win (nor Access) that I am aware of would 'Strip' characters from a file. SOME chars are represented strangely (or not at all) depending on settings (and other acrania ~~ CODE PAGES) -but NOT stripped.

Again, in the region of WHY ranch, I'm not sure WHY you are involved in what is clearly beyond your capacity, but (to be gentle) you just need to do a replace of chr(250) with soemthing else (perhaps Chr(110)?).

Then (AGAIN) we revert to the WHY are you going all long /wrong way around the barn via DOS (and batch file Bar & Grill) to do a simple NAME function?

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
This is for MichaelRed.
When I first started programming I used to eat at the batch file bar grill after having travelled through several barns, but as I got better I discovered there were closer eating places that bypassed the barn. My comment is give davec99 a break, it's advice he needs not smarmy sarcasm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top