|
Stephenos Beginner
Joined: 06 Jul 2007 Posts: 27
|
Posted: Sun Sep 09, 2007 8:45 am
Stripping quotation marks |
I've set up a cures database in CMUD. One of the fields is the 'cured' message that will be sent by the MUD. When I entered the information manually e.g. ^The flow of blood recedes as your (%w) arm's laceration mends.$, everything works fine when I create a #temp trigger by accessing this database field.
I made the mistake of exporting this database so that I could import into Excel for quick changes and additions. When I imported into Excel I left the " mark set as the text qualifier. After making some changes/additions, I re-imported the updated data into a new CMUD database.
Now I find that, occasionally, a #temp trigger will show a pattern like "^The flow of blood recedes as your (%w) arm's laceration mends.$" with "" surrounding the pattern. Obviously, the match never occurs now.
Is there a way to remove these spurious quotation marks? The txt export file doesn't show them. They don't show up in the edit window. Luckily I still had my original handcrafted database.
Thanks |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Sun Sep 09, 2007 12:22 pm |
If the text export file that your exported from Excel doesn't have them, it's rather odd that they ended up in your CMUD database. I guess it must be the way you imported that into CMUD that added the quotes then. You could try and see if that was the case and maybe change your import procedure. How did you import into CMUD?
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Sep 09, 2007 3:07 pm |
Assuming there are no places where quotes are supposed to be in the record you could do this at the command line
YourRecordVariable=%subchar(@YourRecordVariable,%char(34),) |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Stephenos Beginner
Joined: 06 Jul 2007 Posts: 27
|
Posted: Sun Sep 09, 2007 7:45 pm |
I used the import/export feature on the database dialogue.
CMUD export to text.txt -> import to excel from text.txt -> make changes in excel -> save as tab delimited update.txt -> import into new database.
The last column in my database is sparsely populated. I am checking the txt file from excel to see if all the 'tabs' are there when the last column was blank. That may be causing some problem on reimport into the CMUD database.
The %subchar solution would be great, but I have one or two trigger patterns that legitimately have " marks...just not before the ^ and after the $.
Thanks for your replies |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Sun Sep 09, 2007 8:10 pm |
Can you use %subregex, with a pattern of "~"\^" and "~"\$" ? (I think I got those right.)
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Sep 10, 2007 12:02 am |
I think you mean \"\^ and \$\", gamma, don't you?
|
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Mon Sep 10, 2007 12:21 am |
I'm not entirely sure, but wouldn't the character quoting the quote need to be the ZMud quote character instead of the regex quote character? I don't have anything good to test this on at the moment.
|
|
|
|
Stephenos Beginner
Joined: 06 Jul 2007 Posts: 27
|
Posted: Mon Sep 10, 2007 9:31 am |
I may have stumbled on the answer by trial and error.
I manually added a database record and got the same problem of the unwanted quotes, so it wasn't due to laundering my data through Excel.
I was using a wildcard in the trigger, %w, so that it would trap a healed left or right leg. My trigger pattern had %w surrounded by parens (%w) for a possible back reference that I might find a use for later.
That seems to work for a standard trigger, but for a #TEMP trigger, the (...) in the pattern gave me the quoted trigger pattern ,"^Trigger pattern$", as I first described. When I removed the grouping ()'s and just used %w, the temporary trigger generated was what I expected...^Trigger phrase$ with no enclosing quotes.
I think this must be a bug
Thanks for all your help |
|
|
|
|
|