Help with regular expression and replacement string

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Icypher
Posts: 1
Joined: Mon Oct 20, 2003 2:57 pm

Help with regular expression and replacement string

Post by Icypher »

Hello folks...

I am a very new Textpad user. I am trying to import a very large comma delimited text file into SQL Server 7.0. The problem I am having is the text file is written so that all fields have quotation marks surrounding them, declaring them as a character field. An example field would be:

...","619 "E" Street","...

Well you can see the problem. SQL barfs on the "E" because it cannot find the comma.

I am trying to use a regular expression in order to find and replace the above:

[:blank:]["][:alpha:]["][:blank:]

and replace it with

[:blank:][:alpha:][:blank:]

but as you probably guessed, it does not work. Any help would be greatly appreciated.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

[:blank:] and the others are for use inside a character class, they are NOT character classes of their own.

Also, the literal " does not need to be placed in a character class.

And last, you want to remember the different parts for reusing them in replacement.

Search for:
([[:blank:]])"([[:alpha:]])"([[:blank:]])

and replace by
\1\2\3
Post Reply