[yunqa.de] DIRegEx pattern match

  • From: David Keith <dk@xxxxxxxxxxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Mon, 20 Oct 2008 17:24:16 -0400

I’ve got a sql script that creates over 200 tables with indices etc.
I’ve got over 200+ pipe(|) separated files with data to import to the
200 + tables. I had the idea that I would use regular expressions to
turn the create table(s) script into an import script to run in a DBMS
management utility that allows importing directly from fixed length or
separator based files into database tables.
The regular expression support on the DBMS utility for searching and
replacing in scripts is limited, and doesn’t cover everything that I
need to do. So I started using TextPad which has greater support, but
that doesn’t quite do everything that I wanted to do, and I needed to
write some Delphi code to complete the process.
I thought that with DIRegEx I would be able to do everything that is
possible to do with regular expressions; unfortunately I can’t get
what seems to be simple syntax to work. For example, I need to remove
all CREATE INDEX lines in the script. The following *seems* to be the
correct syntax, but I can’t find any variation of this that would work
in the DIRegEx workbench nor in code:
create index.*;$ Here is a sample line that I need to remove: create index ixfdbahfsclassdrugconcept1 on fdb_ahfsclass_drugconcept
(conceptid);
This is only one example (the first!) that I tried to do using
DIRegEx, but with the 20+ variations that I have tried I can’t get it
to work. Does anyone have any suggestions?
Thanks. David Keith
_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: