I'm working with an HTML document that has consecutive layers with variable left margins i.e. from 307px to 355px
Is there anyway to do a search and replace using a math operator that would subtract 30px from the above amounts? (355px - 30px = 325px)
something like search= left:3??px -30px
and replace the difference.
Ron
Character Math
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Great Ron,
Do you think we need to add a brief tutorial on that? - we have a White Papers and Document Delivery service for that kind of thing
Have you seen the tutorial on restrictions?
http://www.crystalsoftware.com.au/docs
Do you think we need to add a brief tutorial on that? - we have a White Papers and Document Delivery service for that kind of thing
Have you seen the tutorial on restrictions?
http://www.crystalsoftware.com.au/docs
Simon;
A tutorial might be a good idea. I've also downloaded the tutorial on restrictions to see how it can help.
For a pattern search on my project I found I could enter a search string of "355px" and a replace string of "355". This set up the information for the VBScript SUBfilter. I used "processLine = (line - 30) & 'px' & EOL" the result = "325px"...
I didn't know the syntax for VBScript so I just commented out the line count routine of the example script and added my own processLine. I don't know what the rest of the script does but the results work fine.
Ron
A tutorial might be a good idea. I've also downloaded the tutorial on restrictions to see how it can help.
For a pattern search on my project I found I could enter a search string of "355px" and a replace string of "355". This set up the information for the VBScript SUBfilter. I used "processLine = (line - 30) & 'px' & EOL" the result = "325px"...
I didn't know the syntax for VBScript so I just commented out the line count routine of the example script and added my own processLine. I don't know what the rest of the script does but the results work fine.
Ron
Not losing a all text in subfilter?
Hi.
I am trying to make the same thing.
I've done as Ron. Added search and replace filter witch extract only needed number and in subfilter making a math. But I eventualy loosing all other text and get only line of numbers. I can't figure out how to use subfilter to not lose hole text. I've read a white paper about subfilter with no success. Can somebody give me a right direction?
Here is the line from text and my filter:
BenQ-Siemens CF61 12 165.00 5.0900
|--Perl pattern [.*\t(.*)\.00\t.*] with [$1]
| | [ ] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [X] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [X] Maximum match (greedy)
| | [ ] Allow comments
| | [ ] '.' matches newline
| | [ ] UTF-8 Support
| |
| +--VBScript script Timeout: 10000 milliseconds
|
| 'Called for every line in the file
| 'EOL contains the end of line characters (Unix, DOS or Mac) that must be
| 'appended to each line
| function processLine(line, EOL)
| processLine = (line - 2)
| end function
|
|
| 'Called at the start of a processing job -
| 'perform one-time initialisation here
| sub startJob()
| end sub
|
|
| 'Called at the end of a processing job -
| 'destroy any declared objects here
| sub endJob()
| 'do nothing
| end sub
|
|
| 'Called before each file is opened -
| 'perform per-file initialisation here
| function startFile()
| startFile = ""
| end function
|
|
| 'Called before each file is closed -
| 'flush all pending file output here
| function endFile()
| endFile = ""
| end function
|
I am trying to make the same thing.
I've done as Ron. Added search and replace filter witch extract only needed number and in subfilter making a math. But I eventualy loosing all other text and get only line of numbers. I can't figure out how to use subfilter to not lose hole text. I've read a white paper about subfilter with no success. Can somebody give me a right direction?
Here is the line from text and my filter:
BenQ-Siemens CF61 12 165.00 5.0900
|--Perl pattern [.*\t(.*)\.00\t.*] with [$1]
| | [ ] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [X] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [X] Maximum match (greedy)
| | [ ] Allow comments
| | [ ] '.' matches newline
| | [ ] UTF-8 Support
| |
| +--VBScript script Timeout: 10000 milliseconds
|
| 'Called for every line in the file
| 'EOL contains the end of line characters (Unix, DOS or Mac) that must be
| 'appended to each line
| function processLine(line, EOL)
| processLine = (line - 2)
| end function
|
|
| 'Called at the start of a processing job -
| 'perform one-time initialisation here
| sub startJob()
| end sub
|
|
| 'Called at the end of a processing job -
| 'destroy any declared objects here
| sub endJob()
| 'do nothing
| end sub
|
|
| 'Called before each file is opened -
| 'perform per-file initialisation here
| function startFile()
| startFile = ""
| end function
|
|
| 'Called before each file is closed -
| 'flush all pending file output here
| function endFile()
| endFile = ""
| end function
|
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact: