Newbie help with clips... THANKS IN ADVANCE
- 1. Say I have several lines like this:
March 6, 2014, 9:49 PM
March 6, 2014, 7:49 AM
March 6, 2014, 8:49 PM
2. I want a search and replace command only to work on the "PM" lines. How would I do that? Say the command is to remove the commas.
3. I want to put each element (for example the first one) in individual variables:
month = variable "mo"
day = variable "da"
year = variable "yr"
hour = variable "hr"
minute = variable "mn"
Note that REGEX is acceptable. I'm just not familiar enough with it.
4. Finally, how would I loop through the active document, place each line into a variable, then after I do something with it, place it back into the same location.
Thanks in advance.
- mygroups77054@... wrote:
> 2. I want a search and replace command only to work on the "PM" lines.Search for "<other stuff>PM$"
> each element (for example the first one) in individual variables:Get rid of commata, replace colon by space and
> month = variable "mo"
^!SetListDelimiter " " or
> loop through the active document, place each line into a variable,^!Find
> then after I do something with it, place it back into the same location.
Note: InsertText is slow on big files, i.e. several hundred inserts.
I use search/replace all the time in clips. I have found it to be incredibly helpful in assembling content into website pages.
I’m confronted with an issue that I thought I had a clip for, but I don’t … and the repository online is still not moved …
I have an export file from a WordPress blog that is like this:
>menustyle<whatever the content is for this field and then the close>/menustyle<
What I want to do is to remove both of the code’s, the start menustyle, and the end menustyle plus everything between them.
I’m not a wizard with this stuff and can’t figure this out.
On Thursday, March 6, 2014, 3:26:31 PM, mygroups77054@... wrote:
myc> Note that REGEX is acceptable. I'm just not familiar enough with
If you'd like to learn more, I recommend The AWK Programming Language,
by Aho, Kernighan and Weinberger. The part that deals with regular
expressions is very useful in itself, and probably a better way to
start than wading into a whole book about nothing else. Also, if you
get interested, AWK is one of the scripting languages that NoteTab
understands. I have a number of clips that combine AWK scripts with
native NoteTab functions.