You are here

How to remove/replace "special characters"?

5 posts / 0 new
Last post
chjohans
Offline
Donator
Joined: 10 years
Last seen: 6 months
How to remove/replace "special characters"?

I'm trying to remove the string "(n) from my description, and likewise I'm trying to substitute ".." with only one ".".

index_description.modify {remove("(n)")|(n)}
index_description.modify {replace("..")|..|.}

 

Really straightforward, but this does not work. My guess is that "()." are considered "special characters" by the interpreter and that they must be somehow "escaped" for this to work. But the included documentation does not mention this, or at least I can't find it anywhere.

 

This does not work either:

index_description.modify {remove("\(n\)")|\(n\)}
index_description.modify {replace("\.\.")|\.\.|\.}

 

How do I modify the above code so uit actually works?

francis
Offline
francis's picture
Has donated long time agoWG++ Team member
Joined: 12 years
Last seen: 1 week
Is the support helpful?
support us

chjohans,
 
The (n) at the end of the description, is not actualy data that is grabbed from a site. It is a mark that WG++ adds, at the end of the description, to indicate that this show if new.
So when you always run WG++ in update="f", it will always put this at the end of every show.
When you run WG++ in an incremental mode, only the shows that are different, will have the (n) at the end.
You can disable this feature in the config file.
Just add a 'n' to your <mod> settens, and no marks will be added anymore. see http://webgrabplus.com/documentation/configuration/webgrabconfigxml#conf... for more details.
 
The .. story. Try just

index_description.modify {cleanup}

Probably it will already fix your problem.

chjohans
Offline
Donator
Joined: 10 years
Last seen: 6 months

Aha, thank youm that explains a lot thank you!
Re the double full stops "..", I am already doing a index_description.modify {cleanup} but that does not seem to solve the problem. How do I replace them witn only one?
 

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 13 hours
Is the support helpful?
support us

Hi ,
regarding the removal of ..
Your solution index_description.modify {replace("..")|..|.} cannot work because of ("..") . This is a preconditional argument (see 4.6.2.1 of the manual) that, in the way you entered it, is a short way of ('index_description' = "..") . So it only works if the description is (=) ".." If you want to use a preconditional here it should be ('index_description' ~ "..") which is the condition that the description -contains- "..". But you don't need a preconditional here. You can simply use
index_description.modify {replace|..|.}   or index_description.modify {remove|..}
 
Jan

chjohans
Offline
Donator
Joined: 10 years
Last seen: 6 months

Aha, my mistake. Sorry lots of doc to read and be familiar with. Thanks, and thanks for an excellent program!

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl