Stripping an HTML File Before Uploading

March 10, 2007 on 3:07 am | In Special Clips - for someone | No Comments

Corl asked how to strip down an html file before uploading with notetab. His theory is that he doesn’t need comments on his remote copy and spaces and tabs and so forth for clear readability actually slow up/downloading and take unneccesary bandwidth. I suppose in a sense he’s right and so long as you keep your original copy … you can upload the stripped copy.

Here is a clip to do it:
;clip for Corl to strip down html files
;whacked at by don at htmlfixit dot com
;dated 03/09/2007
;copy online at:
;http://htmlfixit.com/blog/?p=355
;following line should remove all comments in html document
^!Replace "<!-- .* -->" >> "" ACIWRS
;should remove all returns
^!Replace "^P" >> "" ACIWS
;should remove all tabs
^!Replace "^T" >> "" ACIWS
;should remove all double spaces
^!Replace "\s+" >> " " ACIWRS
;should replace all > < with ><
^!Replace "> <" >> "><" ACIWS

Make Content Between Span Tag Lower Case

March 24, 2006 on 4:05 am | In Special Clips - for someone | No Comments

This clip will find span tags and turn the content inside of them to lower case. The clip does not impact the first character or that string however. This is in response to a post to the clip list on yahoogroups.

;*** Effort by Don Passenger
;*** don at htmlfixit dot com
;*** discuss things live in chat at http://htmlfixit.com
;*** donations welcome at http://htmlfixit.com
;this clip will make all content between span tags
;lowercase except that first character of string
;is not affected
;posted at http://htmlfixit.com/blog/?p=352

;go to start of document
^!Jump Doc_Start

;loop to check each tag to see if it is a meta
:Loop
;find next tag start
^!Find “<” TIS
;quit when no more tags
^!IfError Finish

^!ClearVariables
;### %TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not span cycle to next via NotTag subroutine
^!Set %TAG%=”^$GetHtmlTag(TRUE)$”
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%=”^$GetHtmlTagName(“^%TAG%”;UPPERCASE)$”
^!If “SPAN” = “^%TAGNAME%” SPAN ELSE NotTag

:NotTag
^!Jump Select_End
^!Goto Loop

;if span tag, process text to lowercase
:Span
^!SetDebug On
^!Jump Select_End
;figure out where cursor is
^!Set %row%=”^$GetRow$”
^!Set %column%=”^$GetCol$”
:SpanEnd
;find end meta tag
^!Find “<” TIS
^!Set %TAG%=”^$GetHtmlTag(TRUE)$”
^!IfTrue ^$IsEmpty(^%TAG%)$ SpanEnd
^!Set %TAGNAME%=”^$GetHtmlTagName(“^%TAG%”;UPPERCASE)$”
^!If “/SPAN” <> “^%TAGNAME%” SpanEnd
;get in front of the tag
^!Jump Select_Start
;select between spans
^!SelectTo ^%row%:^$Calc(^%column%+1)$
^!Keyboard CTRL+L
^!Goto Loop

;line 54 including all blanks and comments

Set_View ini and disk BufferS

January 24, 2006 on 7:54 pm | In Notetab Clips, Special Clips - for someone, test clips | No Comments

Reposted 2/2/06
Here are revised, REVISED, clips, one to use NoteTabs users inifile feature to store tidbits of information, the other, to use disk files as a temporary storage medium.

For setting new buffers the clip uses the first word in the selection, if it is descriptive enough you can accept that name or type over with your own name choice.

Both approaches appear to work well, the disk file method doesn’t have the text selection size limitations of the ini file storage method.

Both approaches store a variable in memory at buffer creation. If you perform an action that wipes the variable, change or close the clipbook, close NoteTab, shut down the computer, you can regenerate the memory variable.

Go into the View_Set mode, select the buffers for which you want to regenerate memory variables, as you step thru each buffer view the variable is reset.

BOTH CLIPS ARE ON THIS PAGE.

<>····················<>
Set_View ini BufferS

Select between Markers, Add to ClipBook.

<>------------Marker------------<>
H="Set_View ini BufferS"
;_ Modified-Updated~Created_20060202
;_ hrs ø hsavage·pobox·com_11:05:59a
^!ClearVariables
^!Set %ww%=^$IsWordWrap$
^!SetScreenUpdate 0
^!SetIniFile ^$GetLibraryPath$Buffers
; - if no selection made, opens buffers.ini or exits
^!If ^$GetSelSize$ < 11 OPENFILE
; - seizes first word of selection as buffer name, can be typed over
^!Set %add%=^?{NAME BUFFER ADDITION=^$GetWord$}
^!Set %add%=^$StrReplace(" ";"_";^$StrTrim("^%add%")$;0;0)$
^!SaveValue ^$StrUpper("^%add%")$=^$GetSelection$
^!Select 0
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
^!Set %^$StrLower("^%add%")$%=^$GetValue("^%add%")$
;^!Set %p_^$StrLower("^%add%")$%=^$GetValue("^%add%")$
; ·-·-·
^!Goto REAL_END
; ·-·-·-·-·
:OPENFILE
^!IfFileExist ^$GetLibraryPath$Buffers.ini NEXT ELSE EXIT
^!Open ^$GetLibraryPath$Buffers.ini /j=1
^!SetWordWrap 0
; ·-·-·-·-·
:MAKE_LIST
; - loops thru and lists keys
^!Find ^[A-Z0-9_]+= RS
^!IfError SET_ARRAY
^!Set %extract%=^$StrReplace("=";"";"^$GetSelection$|";0;0)$
^!Append %list%=^%extract%
^!Goto MAKE_LIST
; ·-·-·-·-·
:SET_ARRAY
; - shows an array of key names
^!Set %list%=^$StrDeleteRight("^%list%";1)$
^!SetListDelimiter |
^!SetArray %list%=^?{(H=26;T=A)INI-BUFFER/S TO CHOOSE!==^%list%}; %bfr_action%=^?{VIEW BUFFERS, SET VARS -- DEL BUFFERS, CLEAR VARS==_VIEW_SET|DEL_CLEAR|VIEW_ONLY-ALL_BUFFERS}
; ·-·-·
:VIEW_ONLY-ALL_BUFFERS
; - to view buffer only, make no selection
^!If "^%list%" = "" EXIT ELSE ^!Close DISCARD
^!Set %loop%=0; %count%=^%list0%
; ·-·-·-·-·
:LOOP
^!Inc %loop%
^!Set %bfr_key%=^$GetValue("^%list^%loop%%")$
; ·-·-·
; - clears, resets chosen variable
^!ClearVariable %^$StrLower("^%list^%loop%%")$%
^!ClearVariable %p_^$StrLower("^%list^%loop%%")$%
; - switch comment from 'p_' line to set "permanent Variable"
^!Set %^$StrLower("^%list^%loop%%")$%=^%bfr_key%
;^!Set %p_^$StrLower("^%list^%loop%%")$%=^%bfr_key%
; ·-·-·
^!Goto ^%bfr_action%
; ·-·-·-·-·
:VIEW_SET
^!Info [L]TIDBIT·····^%list^%loop%%^%nl%^%nl%^%bfr_key%
^!Goto ANOTHER_LOOP?
; ·-·-·-·-·
:DEL_CLEAR
; - delete key, clear associated variable,
^!ClearValue ^%list^%loop%%
; ·-·-·
; - switch comment from 'p_' line to clear "permanent Variable"
^!ClearVariable ^%list^%loop%%
;^!ClearVariable %p_^%list^%loop%%%
; ·-·-·-·-·
:ANOTHER_LOOP?
^!If ^%loop% < ^%count% LOOP
; ·-·-·-·-·
:REAL_END
^!StatusClose
^!SetWordWrap ^%ww%
<>------------Marker------------<>

Number of Valid Clip-lines=76

<>··········Separator··········<>

Set_View Disk BufferS

Select between Markers, Add to ClipBook.

<>------------Marker------------<>
H="Set_View Disk BufferS"
;_ Modified-Updated~Created_20060202
;_ hrs ø hsavage·pobox·com_12:04:09a
; ·-·-·
; - Buffer names are restricted to characters
; - available for use in filenames
^!ClearVariables
^!SetScreenUpdate 0
^!Set %ww%=^$IsWordWrap$
; ·-·-·
^!Set %bfr_idx%="^$GetExpandedName(^##)$"
^!Set %bfr_dir%="^$GetDocumentPath$Buffers\"
; ·-·-·
; - adjustable, unless selection is => 11 characters
; - clip diverts to view/clear section
^!If ^$GetSelSize$ < 11 SET_ARRAY
; ·-·-·
^!IfFileExist "^%bfr_dir%nul" SKIP_1 ELSE NEXT
^!MkDir "^%bfr_dir%"
; ·-·-·-·-·
:MAKE_BFR
^!Set %bfr_name%=^?{ENTER MAKE_BUFFER NAME=^$GetWord$}
^!Set %bfr_name%=^$StrReplace(" ";"_";^$StrTrim("^%bfr_name%")$;0;0)$
^!SetCode %bfr_txt%=^$GetSelection$
^!TextToFile "^%bfr_dir%^$StrUpper(^%bfr_name%)$" ^%bfr_txt%
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
;^!Set %^$StrLower("^%bfr_name%")$%="^%bfr_txt%"
^!Set %p_^$StrLower("^%bfr_name%")$%="^%bfr_txt%"
; ·-·-·
^!Goto REAL_END
; ·-·-·-·-·
:SET_ARRAY
^!SetListDelimiter |
^!Set %files%=^$GetFiles("^%bfr_dir%";"*.*";NAME)$
^!If ^%files%=^%EMPTY% END
^!Set %files%=^$StrReplace("^%bfr_dir%";"^%empty%";"^%files%";0;0)$
^!SetArray %files%=^?{(H=26;T=A)BUFFER FILE TO CHOOSE!==^%files%}; %bfr_action%=^?{Open-Set vars, View-Set vars, DEL Files, Clear Vars==OPEN_SET|_VIEW_SET|DEL_CLEAR}
; ·-·-·
;_END_IF_NO_CHOICE
^!IfTrue ^$IsEmpty(^%files%)$ NEXT ELSE SKIP_3
^!StatusShow NO FILE SELECTED
^!Delay 25
; ·-·-·
^!Goto REAL_END
; ·-·-·
^!Set %loop%=0; %count%=^%files0%
; ·-·-·-·-·
:LOOP
^!Inc %loop%
^!Set %bfr_name%=^$GetFileName(^%files^%loop%%)$
^!SetCode %bfr_txt%=^$GetFileText("^%bfr_dir%^%bfr_name%")$
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
;^!SetCode %^$StrLower("^%bfr_name%")$=^%bfr_txt%
^!SetCode %p_^$StrLower("^%bfr_name%")$%=^%bfr_txt%
; ·-·-·
^!Goto ^%bfr_action%
; ·-·-·-·-·
:OPEN_SET
; - this will open the buffer file as an ordinary file
^!Open ^%bfr_dir%^%bfr_name%
; ·-·-·
^!Goto ANOTHER_LOOP?
; ·-·-·-·-·
:VIEW_SET
; - this will display in an ^!Info [L] box, can be selected and pasted
^!Info [L]TIDBIT·····^%bfr_name%^%nl%^%nl%^%bfr_txt%
; ·-·-·
^!Goto ANOTHER_LOOP?
; ·-·-·-·-·
:DEL_CLEAR
; - ^!RecycleFile or ^!DeleteFile, to recycle or, delete from disk
^!RecycleFile "^%bfr_dir%^%bfr_name%"
; ·-·-·
; - switch comment from 'p_' line to set "permanent Variable"
;^!ClearVariable %^$StrLower("^%bfr_name%")$%
^!ClearVariable %p_^$StrLower("^%bfr_name%")$%
; ·-·-·-·-·
:ANOTHER_LOOP?
^!If ^%loop% < ^%count% LOOP
; ·-·-·-·-·
:REAL_END
^!StatusClose
^!SetWordWrap ^%ww%
<>------------Marker------------<>

Number of Valid Clip-lines=85

Scramble_Multi Words

January 14, 2006 on 7:40 am | In General, Notetab Clips, Special Clips - for someone | No Comments

This clip, when run on normal text scrambles the characters in 4 letter words and above without altering the formatting of the text. It leaves the first and last characters of each word unchanged but scrambles the others.

I don’t know who’s responsible for the original algorithm but a writer, he thought it might make interesting reading, located an old clip named ‘JabberWords’ thru Google.

It would scramble most words but would leave some unscrambled, to be expected when randomizing any sequence. I modified the clip so it would not leave any unscrambled words of 4 characters or greater. Although, some 4 letter words are impossible to scramble in this manner.

Words such as seek, keep, been or look and others will not change.

This is the first paragraph, above, in scrambled form;

Tihs cilp, wehn run on nmraol txet sbraelcms the crhcartaes in 4 lteetr wdors and avboe wtuohit atrneilg the fiatorntmg of the txet. It lavees the frist and lsat caarchrets of ecah wrod ucanehgnd but slmrecabs the oherts.

Scramble_Multi Words

Cut and Paste what’s between the markers.


<>------------Marker------------<>
H="Scramble_Multi"
;_ Modified-Updated~Created_20060107
;_ hrs ø hsavage·pobox·com_11:09:29p
^!ClearVariables
; -place cursor in line where scrambling to start
^!Select LINE
^!Select 0
^!Set %rowCol%=^$GetRow$:^$GetCol$
^!Set %letters%=[a-zA-Z']
^!Set %letters4%=^%letters%^%letters%^%letters%^%letters%
^!SetScreenUpdate 0
;
:LOOP
^!Find "^%letters4%+" RS
^!IfError END_LOOP
;
:BASEDUP
^!Set %baseDup%=^$GetSelection$
^!Set %baseWord%=^$GetSelection$
^!Set %baseLen%=^$StrSize(^%baseWord%)$
; checks for 4 character words and handles accordingly.
^!If ^%baseLen% = 4 NEXT ELSE SCRAMBLE
^!If ^$StrCopy("^%baseWord%";2;1)$ <> ^$StrCopy("^%baseWord%";3;1)$ SCRAMBLE
;
:REWORD
; if scrambling is passed sets newWord = baseWord
^!Set %newWord%=^%baseWord%
^!Goto PASS
;
:SCRAMBLE
^!Set %firstChar%=^$StrIndex(^%baseWord%;1)$
^!Set %lastChar%=^$StrIndex(^%baseWord%;^%baseLen%)$
^!Set %newLen%=^$Calc(^%baseLen%-2)$
^!Set %baseWord%=^$StrCopy(^%baseWord%;2;^%newLen%)$
^!Set %randSort%=^%empty%
;
:BUILD_LOOP
^!if ^%baseWord%=^%empty% END_BUILD_LOOP
^!Set %randSort%=^%randSort%< ^$StrRandom(9;01)$>^$StrIndex(^%baseWord%;1)$^%nl%
^!Set %baseWord%=^$StrCopy(^%baseWord%;2;100)$
^!Goto BUILD_LOOP
;
:END_BUILD_LOOP
^!Set %sortedBlock%=^$StrSort(^%randSort%;0;1;0)$
^!Set %randWord%=^$StrStripHTML(^%sortedBlock%;0)$
^!Set %newWord%=^%firstChar%^$StrReplace(" ";^%empty%;^%randWord%;1;0)$^%lastChar%
;
; if newWord = baseWord, jumps
^!IfSame "^%newWord%" "^%baseDup%" BASEDUP
;
:PASS
^%newWord%
^!Jump SELECT_END
^!Goto LOOP
;
:END_LOOP
^!SetScreenUpdate 1
^!SetCursor ^%rowCol%
<>------------Marker------------<>

Number of Valid Clip-lines=58

ImageWrap

January 12, 2006 on 5:31 am | In Notetab Clips, Special Clips - for someone | No Comments

Select between the markers and paste into a new file named – ImageWrap.clb. Place in the Notetab Libraries folder

I’m having a problem getting this to display correctly to enable you to get a correct copy/paste.

If you copy/paste this library everything should be normal, except, double quotes. You will have to do a Search/Replace, search for – &quot; -, replace with the regular double quote character.


<>------------Marker------------<>
= V5 MultiLine NoSorting TabWidth=30

H="ReLoad Starting Files"
; in case you stop mid-clip and want to reload the
; files that were loaded when you started the clip.
^!OpenFavorites ImageWrap
^!DeleteFile ^$GetFavoritePath$ImageWrap.fvr

H=";Image_Wrap - IMPORTANT"
==========================================
Adapted, by many, from an original by Joe Barta jbarta@apk.net

http://junior.apk.net/~jbarta/image-wrap/

fortiter at gmail dot com
;_ Modified-Updated~Created_20060111
;_ hrs ø hsavage·pobox·com_06:50:10p
==========================================

"THIS LIBRARY 'AUTOMATICALLY SAVES AND CLOSES ALL OPEN FILES WHEN RUN'. WHEN IMAGEWRAP FINISHES FILES THAT WERE CLOSED, ARE RE-OPENED." You do not have to close files manually.

Convert a group of images into a suite of HTML pages linked from a single index page.

THE INDEX FILE MUST BE CREATED IN A DIRECTORY ABOVE - CLOSER TO THE ROOT FOLDER - (OR IN THE SAME DIRECTORY AS) THE IMAGES.

Click 'Begin New Pic_Index', make appropriate choices in dialogs and clips will build wrapper for the selected picture files.

When Selecting Pictures, Each Group In The Same Folder Must Be Selected As A Group, Re_Do The Image Loop To Select Pictures In Different Folders.

You Can Customize The Html Files By Digging Into The Clips "_Wrapper" And "_Index".

H="; ···················"

H="Build New Pic_Index"
^!ClearVariables
^!SetScreenUpdate 0
^!SaveFavorites ImageWrap
^!Close ALL,SAVE
;
^!Save As ^?[(T=S;F="All Files (*.*)|*.*")CHOOSE IMAGE FOLDER AND SAVE YOUR INDEX FILE=piclist.html]
;
^!Set %imagewrap_doc%=^$GetExpandedName(^##)$
^!Set %base_path%=^$GetPath(^$StrDeleteLeft("^%imagewrap_doc%";2)$)$
^!Set %base_path%=^$StrReplace("\";"/";"^%base_path%";0;0)$
^!Set %base_path%=file:///C|^%base_path%
;
^!Set %bgcolor%=^?[BACKGROUND COLOR (SELECT OR ENTER HEX CODE)=_FFFFFF (White)^=FFFFFF|000000 (Black)^=000000]
;
^!Set %txtcolor%=^?[TEXT COLOR (SELECT OR ENTER HEX CODE)=FFFFFF (White)^=FFFFFF|_000000 (Black)^=000000]
;
^!Set %doc_title%=^?[SET A TITLE FOR HTML FILES? (Leave Blank For None)=Image Collection]
;
^!Set %p_size%=^?[(H=9)Change DEFAULT to FRACTIONAL size, BETTER to VIEW.==100%^=1.0|90%^=.9|80%^=.8|70%^=.7|_60%^=.6|50%^=.5|40%^=.4|30%^=.3]
^!SetWordWrap 0
;
^!StatusShow Select Pictures In 1 Folder, Click Ok, Re_Do The Image Loop To Pick More Pictures.
^!Delay 40
^!StatusClose
;
:IMAGESELECT
^!Jump DOC_END
^?{(T=O;S=M;F="Image files (*.jpg;*.gif;*.png)|*.jpg;*.gif;*.png")CHOOSE IMAGE FILES, (Can repeat for files in different folders)}^%nl%
;
; Make item-per-line list removing semi-colons or quotes
^!Replace ";" >> "^P" TIWHSA
^!Replace """ >> "" TIWHSA
^!Skip IMAGE LIST COMPLETE, NO TO PICK MORE, YES/NO?
^!Goto IMAGESELECT
;
:PROCESS
; get the base path_1 of the file list
^!Set %base_path_1%=^$GetPath(^$GetDocName$)$
;
; get the name of file
^!Set %base_name_1%=^$GetFileName(^$GetDocName$)$
;
; get the total lines and initialize line count
^!Set %total_lines%=^$GetLineCount$
^!Set %current_line_number%=1
;
; Set up a pasteboard
^!ToolBar New Document
;
; go to loop
^!FarClip ImageWrap:OPERATE
;
; tidy up on return
; kill the pasteboard
^!Document LAST
^!DestroyDoc
;
; now we're at the file list
^!Select ALL
^!FarClip ImageWrap:Pic_Index
^!Close "^%imagewrap_doc%" SAVE
;
^!OpenFavorites ImageWrap
^!DeleteFile ^$GetFavoritePath$ImageWrap.fvr
^!Open ^%imagewrap_doc%
^!SetDocIndex ^$GetDocIndex("^%imagewrap_doc%")$
^!Prompt All done!

H="_Operate"
^!SetWordWrap 0
^!Document FIRST
^!SetCursor ^%current_line_number%:1
^!Select EOL
^!ToolBar Copy
;
; grab image particulars
^!Set %full_disk_path%=^$GetClipboard$
;
^!Set %img_width%="^$Calc(^$GetImgWidth(^$GetClipboard$)$*^%p_size%;0)$"
;
^!Set %img_height%="^$Calc(^$GetImgHeight(^$GetClipboard$)$*^%p_size%;0)$"
;
^!Set %image_name%=^$GetName(^$GetClipboard$)$
^!Set %image_ext%=^$GetExt(^$GetClipboard$)$
;
; get the relative disk & web path of the image to the file list
^!Document NEXT
^!ToolBar Clear All
^!InsertText ^%full_disk_path%
^!Replace "^%base_path_1%" >> "" TIWHSA
^!Replace "\" >> "/" TIWHSA
^!Select EOL
^!ToolBar Cut
^!Set %relative_web_path%=^$GetClipboard$
;
; build a save as filename out of the full_disk_path
^!ToolBar Clear All
^!InsertText ^%full_disk_path%
;
^!Replace ".gif" >> "_gif" TIWHSA
^!Replace ".jpg" >> "_jpg" TIWHSA
^!Replace ".png" >> "_png" TIWHSA
^!Select EOL
^!ToolBar Cut
^!Set %full_disk_html_path%=^$GetClipboard$.html
;
; build a href out of the relative web path
^!ToolBar Clear All
^!InsertText ^%relative_web_path%
;
^!Replace ".gif" >> "_gif" TIWHSA
^!Replace ".jpg" >> "_jpg" TIWHSA
^!Replace ".png" >> "_png" TIWHSA
^!Select EOL
^!ToolBar Cut
^!Set %href_html_path%=^$GetClipboard$.html
;
; make a nifty wrapper file
^!ToolBar New Document
;
^!FarClip ImageWrap:WRAPPER
^!Save As ^%full_disk_html_path%
^!ToolBar Close Document
;
^!Set %link%=<li><a href="^%href_html_path%">^%image_name%(^%image_ext%)</a></li>
;
; go to the list and insert the link in place of the existing line
^!Document FIRST
^!SetCursor ^%current_line_number%:1
^!Select EOL
^!ToolBar Cut
^!InsertText ^%link%
;
; Stop when line count gets to the end of the list
^!Set %current_line_number%=^$Calc(^%current_line_number%+1;0)$
^!IF ^%current_line_number% = ^%total_lines% EXIT
^!FarClip ImageWrap:OPERATE
;
:EXIT

H="_Wrapper"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^%doc_title%</title>
<!-- Created with ImageWrap

http://junior.apk.net/~jbarta/image-wrap/

modified by don from http://htmlfixit.com
fortiter at gmail dot com
Modified-Updated~Created_20060109
hrs ø hsavage·pobox·com_07:00:59p
-->
<style type="text/css">
<!--
body {background-color:#^%bgcolor%;}
h2, li, li a {color:#^%txtcolor%;}
-->
</style>
</head>

<body>

<p><a href="^%base_path%^%base_name_1%">Return to Image Menu</a></p>
<center>
<img src="^%image_name%^%image_ext%"
width="^%img_width%"
height="^%img_height%"
alt="^%image_name%"
border="0" />

</center>

</body>
</html>

H="_Pic_Index"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>^%doc_title%</title>
<!-- Created with ImageWrap

http://junior.apk.net/~jbarta/image-wrap/

modified by don from http://htmlfixit.com
fortiter at gmail dot com
Modified-Updated~Created_20060109
hrs ø hsavage·pobox·com_07:00:59p
-->
<style type="text/css">
<!--
body {background-color:#^%bgcolor%;}
h2, li, li a {color:#^%txtcolor%;}
-->
</style>
</head>

<body>

<h2>^%doc_title%</h2>
<ul>
^&
</ul>
</body>
</html>

H="; ···················"
<>------------Marker------------<>

Clip to Add class=”wrap” to last TD tag in each TR tag

December 24, 2005 on 8:13 pm | In Notetab Clips, Special Clips - for someone | No Comments

This is written in response to a request from Don Strack on the notetab clips list. His problem is that he wants to have a special class on the last TD tag in each set of TR tags in an existing page. He apparently adds new sets periodically, so he may already have some of them with a class attribute in them.

This clips has the following highlights:

  • it finds matching tr and /tr tag sets
  • it looks backwards through the tr tag to find the last td tag
  • it determines if there is already a class attribute in that td tag … and if yes, move on, if not, it adds it
  • then it steps to the next tr/tr tag set.

    ;*** Effort by Don Passenger
    ;*** don a-t htmlfixit d-o-t com
    ;*** discuss things live in chat at http://htmlfixit.com
    ;*** based on work by Larry and Jody and maybe Wayne
    ;*******************************************************
    ;*** will check for matching tr tags in a table
    ;*** then find the last td tag and if not yet
    ;*** set, add a class to the last td tag in each row

    ;### initialize everything
    ^!ClearVariables
    ^!Jump Doc_Start
    ; ———————————————-***
    ;line 14
    :FindTR
    ; find first tag
    ^!Find “<” TIS
    ;exit if find fails
    ^!IfError EXIT
    ;figure out where cursor is
    ^!Set %row%=”^$GetRow$”
    ^!Set %column%=”^$GetCol$”
    ; ———————————————-***
    ^!SET %START%=^%row%:^%column%
    ; ADDED THIS TO BE ABLE TO HAVE EVERYTHING
    ; SELECTED AT THE END OF THE CLIP
    ; ———————————————-***
    ^!SetScreenUpdate Off
    ^!SetWordWrap Off

    ;### %TAG% will be empty if cursor is not inside a tag.
    ^!Set %TAG%=”^$GetHtmlTag(TRUE)$”
    ^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag

    ;### So we found a tag.  What tag is it?
    ^!Set %TAGNAME%=”^$GetHtmlTagName(“^%TAG%”;UPPERCASE)$”
    ^!Jump Select_End
    ;if this tag is not a TR, look for next tag
    ^!If “^%TAGNAME%” <> “TR” FindTR

    ;only get here if we are in a TR tag
    ^!Set %TAGCOUNT%=1

    ;line 46
    :FindNextTagForwards
    ^!Find “<” TIS
    ^!IfError UnMatched
    ^!Set %TAGTEMP%=”^$GetHtmlTag(TRUE)$”
    ^!IfTrue ^$IsEmpty(^%TAGTEMP%)$ NextTag
    ^!Set %TAGTEMPNAME%=”^$GetHtmlTagName(“^%TAGTEMP%”;UPPERCASE)$”
    ^!If “/” = “^$StrCopyLeft(“^%TAGTEMPNAME%”;1)$” EndTag ELSE BeginTag

    :EndTag
    ^!If “^$StrDeleteLeft(“^%TAGTEMPNAME%”;1)$” <> “^%TAGNAME%” Skip_2
    ^!Dec %TAGCOUNT%
    ^!If “^%TAGCOUNT%” = “0″ Match
    ^!Goto NextTag

    :BeginTag
    ^!If “^%TAGTEMPNAME%” <> “^%TAGNAME%” Skip_2
    ^!Inc %TAGCOUNT%
    ^!If “^%TAGCOUNT%” = “0″ Match
    ^!Goto NextTag

    :NextTag
    ^!Jump Select_End
    ^!Goto FindNextTagForwards

    ;line 71
    :Match
    ^!SetScreenUpdate On
    ^!Jump SELECT_END
    ; ———————————————-***
    ;^!SelectTo ^%row%:^%column%
    ^!SelectTo ^%START%
    ; ———————————————-***
    ;okay we have a complete TR to /TR Selected
    ;now look inside of it for last TD tag

    :FindTD
    ^!Find “<TD” TIBHS
    ^!Set %thisTD%=”^$GetHtmlTag(“Yes”)$”
    ^!Set %thisTDhasclass%=”^$StrCount(“class=”;”^%thisTD%”;No;No)$”
    ^!If ^%thisTDhasclass% > 0 FindTR
    ^!Replace “^$GetHtmlTagName(“^%thisTD%”)$” >> “^$GetHtmlTagName(“^%thisTD%”)$ class=”wrap”" CIHS
    ^!Goto findTR
    ^!Goto Finish

    ;line 91
    :UnMatched
    ^!SetCursor ^%row%:^%column%
    ^!Info [C]This appears to be an unmatched Tag.  We made it to the end of your document without finding a match.
    ^!Goto Finish

    ;### clean up and go home
    :Finish
    ^!SetScreenUpdate On
    ^!SetWordWrap On
    ^!ClearVariables
    ;line 102 if you have all lines unrapped (including blank lines)

Convert Bible Study Guide to HTML Format

June 9, 2005 on 4:11 pm | In Special Clips - for someone | 3 Comments

Alueet wrote:
> Would somebody like to help me, because I can’t make the clips.
> I’m making my own Daily devotion and I use Notetapro writing it and I
> take the text from the finnish Bible.
> Here is the original text and after that the result what I want the clip
> make.
>
> —————————-
> Fil 4:1-9
> (1) Rakkaat ja kaivatut veljeni, te minun iloni ja kunniaseppeleeni,
> pysykää siis horjumatta Herran yhteydessä, rakkaat ystävät!
> (2) Kehotan Euodiaa ja Syntykeä elämään sovussa Herraa palvellen.
> (3) Pyydän myös sinua, uskollinen työtoverini, auttamaan näitä naisia,
> jotka ovat minun kanssani taistelleet evankeliumin puolesta samoin kuin
> Clemens ja muutkin työtoverini, joiden kaikkien nimet ovat elämän kirjassa.
> (4) Iloitkaa aina Herrassa! Sanon vielä kerran: iloitkaa!
> (5) Tulkoon teidän lempeytenne kaikkien ihmisten tietoon. Herra on jo
> lähellä.
> (6) Älkää olko mistään huolissanne, vaan saattakaa aina se, mitä
> tarvitsette, rukoillen, anoen ja kiittäen Jumalan tietoon.
> (7) Silloin Jumalan rauha, joka ylittää kaiken ymmärryksen, varjelee
> teidän sydämenne ja ajatuksenne, niin että pysytte Kristuksessa
> Jeesuksessa.
> (8) Lopuksi, veljet, ajatelkaa kaikkea mikä on totta, mikä on
> kunnioitettavaa, mikä oikeaa, puhdasta, rakastettavaa ja kaunista, mikä
> vain on hyvää ja ansaitsee kiitoksen.
> (9) Tehkää sitä, mitä olette minulta oppineet ja vastaanottaneet, mitä
> olette minulta kuulleet ja minusta nähneet. Silloin rauhan Jumala on
> oleva teidän kanssanne.
> Saakoon ilo ja lempeys täyttää sydämemme. Muistakaamme, että Jumala on
> luvannut pitää meistä huolen. Jumalan rauha asukoon sydämissämme.
> Rakas Jeesus; opeta meitä ajattelemaan puhtaita asioita.
>
> —————————–
>
> Fil 4:1-9

> (1) Rakkaat ja kaivatut veljeni, te minun iloni ja kunniaseppeleeni,
> pysykää siis horjumatta Herran yhteydessä, rakkaat ystävät!
> (2) Kehotan Euodiaa ja Syntykeä elämään sovussa Herraa palvellen.
> (3) Pyydän myös sinua, uskollinen työtoverini, auttamaan näitä naisia,
> jotka ovat minun kanssani taistelleet evankeliumin puolesta samoin kuin
> Clemens ja muutkin työtoverini, joiden kaikkien nimet ovat elämän
> kirjassa.
> (4) Iloitkaa aina Herrassa! Sanon vielä kerran: iloitkaa!
> (5) Tulkoon teidän lempeytenne kaikkien ihmisten tietoon. Herra on jo
> lähellä.
> (6) Älkää olko mistään huolissanne, vaan saattakaa aina se, mitä
> tarvitsette, rukoillen, anoen ja kiittäen Jumalan tietoon.
> (7) Silloin Jumalan rauha, joka ylittää kaiken ymmärryksen, varjelee
> teidän sydämenne ja ajatuksenne, niin että pysytte Kristuksessa
> Jeesuksessa.
> (8) Lopuksi, veljet, ajatelkaa kaikkea mikä on totta, mikä on
> kunnioitettavaa, mikä oikeaa, puhdasta, rakastettavaa ja kaunista, mikä
> vain on hyvää ja ansaitsee kiitoksen.
> (9) Tehkää sitä, mitä olette minulta oppineet ja vastaanottaneet, mitä
> olette minulta kuulleet ja minusta nähneet. Silloin rauhan Jumala on
> oleva teidän kanssanne.

> Saakoon ilo ja lempeys täyttää sydämemme. Muistakaamme, että Jumala on
> luvannut pitää meistä huolen. Jumalan rauha asukoon sydämissämme.
>

> Rakas Jeesus; opeta meitä ajattelemaan puhtaita asioita.

This clip seems to fill the bill:

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
; reformat bible verses

;start at the top (assuming whole file)
^!Jump Doc_Start
;set list delimiter to ( and get array elements
^!SetListDelimiter "("

;verify that there are no blank leading lines
:Check_Leading_Returns
^!Select Eol
;make sure it isn't empty item if it is END
^!If "^$GetSelection$" = "" Leading_Returns ELSE Format_Line_One
:Leading_Returns
^!Continue You have a blank line at the top of your document, can we delete it?
^!Keyboard DELETE

;Format First Line
:Format_Line_One
^!InsertHtml ^$GetSelection$

^!Jump +1

;Find end of (1)
^!Find "1)" TIS
^!IfError ABORT

;find next paragraph
:Process_Paragraph
^!Replace "^P(" >> "
^P(" TIS
^!IfError Process_Final_Paragraphs
^!Goto Process_Paragraph

^!SetDebug On
:Process_Final_Paragraphs
^!Replace ".^P" >> ".

^P" ATIS
^!Info [C]Successful Run, Congratulations
^!Goto End

:ABORT
^!Info [C]An Error Has Occurred -- Sorry

Make Paragraphs with Links From Input

June 6, 2005 on 3:47 pm | In Special Clips - for someone | No Comments

Ok, take this:
U.S. Dive Travel
Offers packages to Bonaire’s Sand Dollar Condominium Resort.

http://www.usdivetravel[...]ONAIRE-Sand_Dollar.html

Sand Dollar Group
Offers project management and support for the development of web
sites, LAN and WAN design, data center relocations and custom
helpdesk integration.

http://www.sanddollargroup.com

Make it into this:


U.S. Dive Travel

Offers packages to Bonaire’s Sand Dollar Condominium Resort.

http://www.usdivetravel[...]ONAIRE-Sand_Dollar.html


Sand Dollar Group

Offers project management and support for the development of web
sites, LAN and WAN design, data center relocations and custom
helpdesk integration.

http://www.sanddollargroup.com

Obviously correcting it to xhtml formatting … cause I just cannot bring myself to use capital html tags any more.

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
; Take paragraphs and make linked paragraphs
; assume double return between paragraphs

;start at the top (assuming whole file)
^!Jump Doc_Start
;set list delimiter to space and get array elements
^!SetListDelimiter "^P"

:paragraph
^!ClearVariables
;set cursor position
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"

;find end of this "paragraph" of info
^!Find "^P^P" CIS
^!IfError END

^!Jump Select_End
;select the paragraph
^!SelectTo ^%row%:^%column%

;break the paragraph into an array
;element one is what will go into the
;link tag, "next-to-last" array element will be the
;link url itself and all "middle" elements
;will form the paragraph
;delimited array set by splitting line on returns
^!SetArray %delimited_data%=^$GetSelection$
;make sure it isn't empty item if it is END
^!If "^%delimited_data1%" = "" END

;delete selected paragraph now
^!Keyboard DELETE

;find the second from last element number
^!Set %link_element%=^$Calc(^%delimited_data0%-2)$
;the following could all be done
;on one long line ... or with short insertHTML's
;followed by jumps ... your choice
^!InsertHtml

^%delimited_data1%
^!Jump Select_End
^!InsertHtml

^P
^!Jump Select_End
;increment index for description
^!Set %indx%=2

:Loop_Description
;display each array element
^!InsertHtml ^%delimited_data^%indx%%
^P
^!If ^%indx% = ^$Calc(^%delimited_data0%-3)$ Next_Paragraph
^!Inc %indx%
^!Goto Loop_Description

:Next_Paragraph
^!InsertHtml

^P^P
^!Jump Select_End
^!Goto paragraph

Find Values in Tags and Total Them

May 10, 2005 on 3:46 pm | In Special Clips - for someone | No Comments

This clip takes the following:
+ =
This person has values in tag sets named as above. I just read the first two values and then spit out the calculated value under the third tag. I don’t really error trap, other than to spit you out if these three tags don’t appear in succession.

;*** Effort by Don Passenger
;*** don a-t htmlfixit d-o-t com
;*** discuss things live in chat at http://htmlfixit.com
;*******************************************************
;*** will take this:
;-130.45
;-13.05
;xxxx
;and calculate the sum-net

; always start at the top of the document
^!Jump DOC_START

:LoopSum
;find the total-sum tag
;find next tag start
^!Find "< " TIS
;quit when no more tags
^!IfError Finish

^!ClearVariables
;%TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not "total-sum" cycle to next via NotTag subroutine
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
^!If "TOTAL-SUM" = "^%TAGNAME%" TOTAL-SUM ELSE NotTag

:NotTag
^!Jump Select_End
^!Goto LoopSum

;if TOTAL-SUM tag, get the value
:TOTAL-SUM
;jump to the end of the TOTAL-SUM tag
^!Jump Select_End
;figure out where cursor is
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"
;find the start of the /total-sum tag
;note I assume it is the next tag
;no error checking
^!Find "<" TIS
;select the number and then load it to a variable
^!SelectTo ^%row%:^%column%
^!Set %SUM%=^$GetSelection$

;NEXT GET THE SUM-VAT VALUE
;advance one line
^!Jump +1
;find the total-sum-vat tag
^!Find "<" TIS
;quit when no more tags
^!IfError Problem
^!Set %TAG2%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG2%)$ Problem
^!Set %TAGNAME2%="^$GetHtmlTagName("^%TAG2%";UPPERCASE)$"
^!If "TOTAL-SUM-VAT" = "^%TAGNAME2%" TOTAL-SUM-VAT ELSE Problem
;if TOTAL-SUM tag, get the value
:TOTAL-SUM-VAT
;jump to the end of the TOTAL-SUM-VAT tag
^!Jump Select_End
;figure out where cursor is
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"
;find the start of the /total-sum-vat tag
;note I assume it is the next tag
;no error checking
^!Find "<" TIS
;select the number and then load it to a variable
^!SelectTo ^%row%:^%column%
^!Set %SUMVAT%=^$GetSelection$

;NEXT DO MATH AND REPLACE THE SUM-NET VALUE
;advance one line
^!Jump +1
;find the total-sum-vat tag
^!Find "<" TIS
;quit when no more tags
^!IfError Problem
^!Set %TAG3%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG3%)$ Problem
^!Set %TAGNAME3%="^$GetHtmlTagName("^%TAG3%";UPPERCASE)$"
^!If "TOTAL-SUM-NET" = "^%TAGNAME3%" TOTAL-SUM-NET ELSE Problem
;if TOTAL-NET tag, get the value
:TOTAL-SUM-NET
;jump to the end of the TOTAL-SUM-NET tag
^!Jump Select_End
;figure out where cursor is
^!Set %row%="^$GetRow$"
^!Set %column%="^$GetCol$"
;find the start of the /total-sum-net tag
;note I assume it is the next tag
;no error checking
^!Find "<" TIS
;select the number and then load it to a variable
^!SelectTo ^%row%:^%column%
;now do the math
^!SetClipboard ^$Calc(^%SUM%+^%SUMVAT%)$
^!Paste

;GET NEXT SET OF TAGS
;advance one line
^!Jump +1
^!Goto LoopSum

:Problem
^!Info [C]we have a tag mismatch -- something is wrong with formatting
^!Goto End

:Finish
^!SetScreenUpdate On
^!ClearVariables
;line 117 if you have all lines unrapped (including blank lines)

Clip for Editing Text: strikeout deletion / bold insertion

March 21, 2005 on 2:10 am | In Special Clips - for someone | No Comments

;whacked at by don at htmlfixit dot com
;from an example by hoylesp at acm dot org
;to edit stuff with three options (1a, 1b and 2)
;1.
;if highlighted text when start, then strike that
; and a.
; nothing if text box left empty
; or b.
; replace with bolded text from prompt box if entered
;2.
;if nothing selected insert added text
;see: http://htmlfixit.com/blog/index.php?p=317 for any updates

;figure out if anything is selected and jump to subroutine
^!If ^$GetCol$ = ^$GetColEnd$ insert ELSE selection_made

;we have a selection so strike it
:selection_made
^!InsertHTML ^&
;move after the selection
^!Jump Select_End

;insert the replace with text if any is given
:insert
^!Set %replacement%=^?{Replace with}
;if nothing entered in Replace jump to end
^!If ^$IsEmpty(^%replacement%)$ = 1 End
;insert in bold with spaces on each side
;if replacement text is given

Clip to Strip Search Terms From Server Logs

February 4, 2005 on 10:50 pm | In General, Special Clips - for someone | 1 Comment

A list user had referrer logs on his server and wanted to strip the search terms from them. I wrote this:

;effort by don at htmlfixit.com
;02/04/05
; to take query terms from lines of stats
;one long example line
;http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q="We are what we know"
;becomes
;"We are what we know"
;turn off wordwrap
^!SetWordWrap Off
;^!SetDebug On
;go to start of document
^!Jump Doc_Start
;loop for cleaning lines
:Loop
;highlight just this line
^!Select Eol
^!Find "?q=" TIHS
^!IfError TryAgain ELSE KillStart

:TryAgain
;sometimes it is &q=
^!Find "&q=" TIHS
^!IfError KillLine ELSE KillStart

:KillLine
;KillLine (not a search with a ?q=)
;delete highlighted line
^!DeleteLine
;repeat til done - if done go to done subroutine
^!If ^$GetRow$ = ^$GetLinecount$ DONE ELSE Next
; next line
^!Goto Loop

:KillStart
;KillStart (get rid of ?q= and everything before it)
;jump to select end
^!Jump Select_End
;select to line beginning
^!Select Bol
;delete highlighted piece
^!Keyboard DELETE

;now get rid of post search terms by finding &
;highlight just this line
^!Select Eol
^!Find "&" TIHS
^!IfError SKIP_3
;jump to select end
^!Jump Select_Start
^!Select Eol
;delete highlighted piece
^!Keyboard DELETE

;repeat til done - if done go to done subroutine
^!If ^$GetRow$ = ^$GetLinecount$ DONE ELSE Next

;advance to next line
^!Jump +1
;repeat
^!Goto Loop

:DONE
^!Info Done

On this test list:

http://cgi.resourceindex.com/detail/09039.html
http://www.google.com/search?q=”Invalid query: Column count doesn’t match value count at row”&sourceid=opera&num=0&ie=utf-8&oe=utf-8
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=rgb color chooser
http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=regular expression remove path from file&btnG=Google Search&meta=cr=countryAU

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.ch/search?q=script download manager php&hl=de&lr=&ie=UTF-8&start=10&sa=N
http://www.google.se/search?hl=sv&ie=UTF-8&oe=UTF-8&q=html scripts +stats&meta=
http://www.google.ca/search?q=PHP string manipulation&ie=UTF-8&oe=UTF-8&hl=en&meta=
http://www.google.com/search?q=perl loops continue&ie=UTF-8&oe=UTF-8
http://www.google.com.hk/search?hl=zh-TW&ie=UTF-8&oe=UTF-8&q=HTML Fix the background&spell=1
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=php splitting value by space
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=”top == self” document.write javascript
http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=”file names” complete list fix
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=”We are what we know”

http://www.dogpile.com/info.dogpl/search/web/can+a+virus+overtake+your+homepage%3F

http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=javascript validator &btnG=Google Search&meta=cr=countryAU

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?q=PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” allowed tags&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
http://www.google.ca/search?q=Regex links jpg&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/File_Management/File_Downloading/

http://www.google.ca/search?q=Column count doesn’t match value count at row 1&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google Search&meta=

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=hello world perl
http://www.google.co.uk/search?q=HTML FIX IT.COM&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google Search&meta=
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=hello world perl script
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=perl find number of items in hash&btnG=Google Search

http://cgidir.com/Scripts/Counters/

http://www.google.com/search?q=php string manipulation&sourceid=opera&num=0&ie=utf-8&oe=utf-8

http://htmlfixit.com/tutes/tute_menu.shtml

http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=php string manipulation
http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=perl if elsif&meta=
http://www.gigablast.com/search?k3j=754263&s=70&q=cgi irc login
http://www.google.com.au/search?q=how to stop people from looking at your HTML source&hl=en&ie=UTF-8&oe=UTF-8

http://www.cgiresourceindex.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.co.hu/search?q=list perl hash array example&btnG=Google keresés&hl=hu&ie=UTF-8&oe=UTF-8

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?q=fix html code&hl=iw&lr=&ie=UTF-8&inlang=iw&start=120&sa=N

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://htmlfixit.com/cgi-bin/yabb/YaBB.cgi?board=stats

http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=tutorials php string manipulation&btnG=Google Search
http://www.google.com.gr/search?hl=el&ie=UTF-8&oe=UTF-8&q=spliti functions tutorial&btnG=Αναζήτηση στο Google&meta=

http://www.freecgicode.com/cgi-bin/dir/search.cgi?query=counter

http://www.google.com.au/search?hl=en&ie=UTF-8&oe=UTF-8&q=mysql insert into matching columns&meta=

http://www.optima-system.com/pagespinner/spinnertalk/viewtopic.php?t=60

http://search.yahoo.com/search?p=examples of while loops in perl&ei=UTF-8&fr=fp-tab-web-t&n=20&fl=0&x=wrt
http://www.google.co.uk/search?hl=en&ie=UTF-8&oe=UTF-8&q=splitting strings in php&spell=1

http://www.optima-system.com/pagespinner/spinnertalk/viewtopic.php?t=60

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=javascript counter free download&btnG=Google Search
http://www.google.co.uk/search?q=xhtml validation tools&ie=UTF-8&oe=UTF-8&hl=en&meta=

http://www.google.com/search?q=PageSpinner&hl=ja&lr=&ie=UTF-8&inlang=ja&start=40&sa=N

http://www.google.ro/search?q=download fix-it utilities 2004 free full&hl=ro&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
http://www.google.com.au/search?q=fix mydoom.f&ie=UTF-8&oe=UTF-8&hl=en&meta=cr=countryAU

http://www.cgi-resources.com/Programs_and_Scripts/Perl/Access_Counters/Combination/

http://www.google.com/search?q=shtml vs html&hl=en&lr=&ie=UTF-8&start=10&sa=N
http://search.yahoo.com/search?p=free scripts download&ei=UTF-8&cop=mss&fr=fp-tab-web-t&b=21
http://www.google.co.uk/search?q=php security issues&hl=en&ie=UTF-8&oe=UTF-8
http://www.google.ca/search?q=xhtml validate&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N

http://groups.yahoo.com/group/Anti-spam/message/2151

http://search.yahoo.com/search?p=xhtml vs. html&ei=UTF-8&fr=fp-tab-web-t&n=20&fl=0&x=wrt
http://www.google.co.in/search?q=payment gateway tutorial&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N
http://www.google.com/search?q=Column count doesn’t match value count at row 1&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8

http://www.hotscripts.com/Detailed/24085.html

That rendered the following:

“Invalid query: Column count doesn’t match value count at row”
rgb color chooser
regular expression remove path from file
script download manager php
html scripts +stats
PHP string manipulation
perl loops continue
HTML Fix the background
php splitting value by space
“top == self” document.write javascript
“file names” complete list fix
“We are what we know”
javascript validator
PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” allowed tags
Regex links jpg
Column count doesn’t match value count at row 1
hello world perl
HTML FIX IT.COM
hello world perl script
perl find number of items in hash
php string manipulation
php string manipulation
perl if elsif
cgi irc login
how to stop people from looking at your HTML source
list perl hash array example
fix html code
tutorials php string manipulation
spliti functions tutorial
mysql insert into matching columns
splitting strings in php
javascript counter free download
xhtml validation tools
PageSpinner
download fix-it utilities 2004 free full
fix mydoom.f
shtml vs html
php security issues
xhtml validate
payment gateway tutorial
Column count doesn’t match value count at row 1

and I then used tools –> text statistics from the toolbar to get this information:

Word Frequency %

- 1 0.51
” 10 5.08
. 4 2.03
: 1 0.51
0 1 0.51
1 3 1.52
2004 1 0.51
allowed 1 0.51
are 1 0.51
array 1 0.51
at 4 2.03
background 1 0.51
by 1 0.51
cgi 1 0.51
chooser 1 0.51
code 1 0.51
color 1 0.51
Column 3 1.52
columns 1 0.51
COM 1 0.51
complete 1 0.51
continue 1 0.51
count 6 3.05
counter 1 0.51
document 1 0.51
doesn’t 3 1.52
download 3 1.52
DTD 1 0.51
elsif 1 0.51
EN 1 0.51
example 1 0.51
expression 1 0.51
f 1 0.51
file 2 1.02
find 1 0.51
fix 5 2.54
fix-it 1 0.51
free 2 1.02
from 2 1.02
full 1 0.51
functions 1 0.51
gateway 1 0.51
hash 2 1.02
hello 2 1.02
how 1 0.51
html 6 3.05
if 1 0.51
in 2 1.02
insert 1 0.51
into 1 0.51
Invalid 1 0.51
irc 1 0.51
issues 1 0.51
IT 1 0.51
items 1 0.51
javascript 3 1.52
jpg 1 0.51
know 1 0.51
links 1 0.51
list 2 1.02
login 1 0.51
looking 1 0.51
loops 1 0.51
manager 1 0.51
manipulation 4 2.03
match 3 1.52
matching 1 0.51
mydoom 1 0.51
mysql 1 0.51
names 1 0.51
number 1 0.51
of 1 0.51
PageSpinner 1 0.51
path 1 0.51
payment 1 0.51
people 1 0.51
perl 6 3.05
php 8 4.06
PUBLIC 1 0.51
query 1 0.51
Regex 1 0.51
regular 1 0.51
remove 1 0.51
rgb 1 0.51
row 3 1.52
script 2 1.02
scripts 1 0.51
security 1 0.51
self 1 0.51
shtml 1 0.51
source 1 0.51
space 1 0.51
spliti 1 0.51
splitting 2 1.02
stats 1 0.51
stop 1 0.51
Strict 1 0.51
string 4 2.03
strings 1 0.51
tags 1 0.51
the 1 0.51
to 1 0.51
tools 1 0.51
top 1 0.51
tutorial 2 1.02
tutorials 1 0.51
utilities 1 0.51
validate 1 0.51
validation 1 0.51
validator 1 0.51
value 4 2.03
vs 1 0.51
W3C 1 0.51
we 2 1.02
what 1 0.51
world 2 1.02
write 1 0.51
xhtml 3 1.52
your 1 0.51

Different words/items counted: 119
Total Words: 176
Total Punctuation: 5
Total Other Text: 6
Total Characters: 1086
Total Paragraphs: 41

I could do lots more with this, like sort on incidence, etc. This is just a start.

Strip HTML except Images and Links

January 14, 2005 on 10:38 pm | In Special Clips - for someone | No Comments

A reader asked if it is possible to strip all html except for image and link tags, and then reformat as a “clean” html page with links and images included in the finished product. I wrote this little script that does it as a notetab clip. It simply substitutes an unusual string for the < and > signs and then resubstitutes those later after removing the html tags. The removal tool is fooled into leaving these in because they are not html tags when they aren’t opened and closed with the <> signs.

;effort by don at htmlfixit.com
;1/13/05

;clip strips html except for image and a href
;tags, reformats to html using notetab
;and then restores fully the image and a href
;tags … note will not preserve tables etc.

;go to start of document
^!Jump Doc_Start
;turn off screen to hasten the job
^!SetScreenUpdate Off

;loop to check each tag to see if it is a meta
:Loop
;set counter to 0 — unless changes will not process
;this tag
^!Set %processtag%=”0″

;find next tag start
^!Find “< " TIS
;quit when no more tags
^!IfError Clean

^!ClearVariables
;### %TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not meta cycle to next via NotTag subroutine
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
^!Set %TAG%="^$GetSelection$"

;if tag is A, /A or IMG (no matter on case)
;then go to DOTAG where we will process it
^!If "A" = "^%TAGNAME%" DOTAG
^!If "/A" = "^%TAGNAME%" DOTAG
^!If "IMG" = "^%TAGNAME%" DOTAG

;get here and go to next tag if not a
;special tag to preserve
:NotTag
^!Jump Select_End
^!Goto Loop

;process three special tags by putting
;unusual character sequence before and
;after and then it won't be removed
:DOTAG
^!Set %TAG%=^$StrDeleteLeft("^%TAG";1)$
^!Set %TAG%=^$StrDeleteRight("^%TAG";1)$
^!Set %TAG%=**|[|**^%TAG**|]|**
^!InsertText ^%TAG%
^!Goto NotTag

:Clean
;remove html (won't remove the replaced
;things as it doesn't think they are html
^!Keyboard SHIFT+CTRL+T
;convert document to html document
^!ToolBar Document to HTML
;reinstate the < and > so they
;magically become html tags again
;for the special three A, /A, IMG
^!Replace “**|[|**" >> "< " ATIWS
^!Replace "**|]|**” >> “>” ATIWS
;turn screen back on
^!SetScreenUpdate Off
;finish at the top
^!Jump Doc_Start
;tell em we are done
^!Info [C]finished with this file
;exit the clip
^!Goto EXIT
;line 77 including all blanks and comments

Strip Meta Keyword/Description Tags

January 13, 2005 on 9:15 pm | In Special Clips - for someone | No Comments

This clip will strip the meta tags but preserves the keywords and descriptions as html comments.

;effort by don at htmlfixit.com
;1/13/05

;clip strips html meta tags of type
;keywords and description from a document
;but leaves the keywords or description content
;in a comment with a preceeding comment saying
;what tag it came out of

;go to start of document
^!Jump Doc_Start

;loop to check each tag to see if it is a meta
:Loop
;set counter to 0 -- unless changes will not process
;this tag
^!Set %processmeta%="0"

;find next tag start
^!Find "< " TIS
;quit when no more tags
^!IfError Finish

^!ClearVariables
;### %TAG% will be empty if cursor is not inside a tag.
;determine if tag and get the name of the tag
;if not meta cycle to next via NotTag subroutine
^!Set %TAG%="^$GetHtmlTag(TRUE)$"
^!IfTrue ^$IsEmpty(^%TAG%)$ NotTag
^!Set %TAGNAME%="^$GetHtmlTagName("^%TAG%";UPPERCASE)$"
^!If "META" = "^%TAGNAME%" Meta ELSE NotTag

:NotTag
^!Jump Select_End
^!Goto Loop

;if meta tag, figure out if it is a description
;or a keyword metatag
:Meta
^!Set %METATAG%="^$GetSelection$"
;two long lines follow
^!Set %METAHTTP%="^$StrPos("HTTP-EQUIV=";"^$StrUpper("^%METATAG%")$";False)$"
^!Set %METADESCRIPTION%="^$StrPos("Description";"^$StrUpper("^%METATAG%")$";False)$"

;if description click the counter to one so we know what it is
^!If "^%METADESCRIPTION%" <> "0" next ELSE Skip_1
^!Set %NEEDPROCESSING%="1"

;if it is keyword click the counter to two so we know what it is
;long line follows
^!Set %METAKEYWORDS%="^$StrPos("Keywords";"^$StrUpper("^%METATAG%")$";False)$"
^!If "^%METAKEYWORDS%" <> "0" next ELSE Skip_1
^!Set %NEEDPROCESSING%="2"

^!If "^%NEEDPROCESSING%" = "0" Loop ELSE ProcessMeta

;we have either description or keywords meta
;so process it
:ProcessMeta
;trim out everything before and after content
;using left and right trims or copies
;long line follows
^!Set %METACONTENT%="^$StrPos("CONTENT=";"^$StrUpper("^%METATAG%")$";False)$"
^!Set %METACONTENT%=^$Calc(^%METACONTENT%+7)$
^!Set %METATAG%=^$StrDeleteLeft("^%METATAG";^%METACONTENT%)$
^!Set %QUOTE%="^$StrCopyLeft("^%METATAG";1)$"
^!Set %METATAG%=^$StrDeleteLeft("^%METATAG";1)$
^!Set %CLOSEQUOTE%="^$StrPos("^%QUOTE%";"^%METATAG%";False)$"
^!Set %METATAG%=^$StrCopyLeft("^%METATAG%";^$Calc(^%CLOSEQUOTE%-1)$)$

;insert proper comment for type of tag being cleaned
^!If "^%NEEDPROCESSING%" = "1" Next ELSE Skip_1
^!InsertHtml 
^!If "^%NEEDPROCESSING%" = "2" Next ELSE Skip_1
^!InsertHtml 

;replace the existing tag with the words in a comment tag
^!InsertHtml 

^!Goto NotTag


:Finish
^!Info [C]finished with this file
^!Goto EXIT
;line 86 including all blanks and comments

List all capitalized words in a file

December 4, 2004 on 10:12 pm | In Special Clips - for someone | No Comments

A reader on the notetab list asked for a clip to generate a list of words with a first letter capitalized (the rest of the word can be upper or lower cased so long as the first letter is capitalized). I tried a couple of versions that worked pretty well on my test files. Because the sort function puts umlauted characters at the bottom of the alphabet in a sort and the reader wanted to preserve umlauted characters, I decided that this method was better. This clip ran 8 minutes for the reader on a 500K file. I didn’t disable screen update so you can see the progress, but that also slows the machine.

Here is the clip:

; by don at htmlfixit.com
; using a bunch of Hugo's ideas
; runs a text file and makes
; a list of all words that start
; with a capital letter
^!Menu Edit/Copy All
^!Toolbar Paste New
^!Replace "^P" >> " " ATIWS
^!Replace ")" >> " " ATIWS
^!Replace "(" >> " " ATIWS
^!Replace """ >> " " ATIWS
^!Replace "^T" >> " " ATIWS
^!Replace "," >> " " ATIWS
^!Replace "[" >> " " ATIWS
^!Replace "]" >> " " ATIWS
^!Replace "< " >> " " ATIWS
^!Replace ">" >> " " ATIWS
^!Replace "~" >> " " ATIWS
^!Replace "!" >> " " ATIWS
^!Replace "@" >> " " ATIWS
^!Replace "#" >> " " ATIWS
^!Replace "$" >> " " ATIWS
^!Replace "%" >> " " ATIWS
^!Replace "^" >> " " ATIWS
^!Replace "&" >> " " ATIWS
^!Replace "*" >> " " ATIWS
^!Replace "_" >> " " ATIWS
^!Replace "+" >> " " ATIWS
^!Replace "=" >> " " ATIWS
^!Replace "|" >> " " ATIWS
^!Replace "{" >> " " ATIWS
^!Replace "}" >> " " ATIWS
^!Replace "" >> " " ATIWS
^!Replace "/" >> " " ATIWS
^!Replace "?" >> " " ATIWS
^!Replace "." >> " " ATIWS
^!Replace ";" >> " " ATIWS
^!Replace ":" >> " " ATIWS
^!Replace "" >> " " ATIWS
^!Replace "•" >> " " ATIWS
^!Replace "– " >> " " ATIWS
^!Replace "´" >> " " ATIWS
^!Replace "’" >> " " ATIWS
^!Replace "“" >> " " ATIWS
^!Replace "‘" >> " " ATIWS
^!Replace "`" >> " " ATIWS
^!Replace "¡" >> " " ATIWS
^!Replace "¢" >> " " ATIWS
^!Replace "£" >> " " ATIWS
^!Replace "¤" >> " " ATIWS
^!Replace "¥" >> " " ATIWS
^!Replace "§" >> " " ATIWS
^!Replace "©" >> " " ATIWS
^!Replace "«" >> " " ATIWS

^!Menu Modify/Spaces/Single Space
^!Replace " " >> "^P" ATIWS
^!Replace "^P´" >> "^P" ATIWS
^!Replace "^P-" >> "^P" ATIWS
^!Replace "^P " >> "^P" ATIWS
^!Menu Edit/Copy All
^!SetClipboard ^$StrSort("^$GetClipboard$";1;1;1)$
^!Select All
^!Toolbar Paste
^!Jump 1

; following is to dump all numer or lower cased
; first character lines
:DumpBad
^!If ^$GetRow$ = ^$GetLinecount$ Sort2
^!Select +1
^!IfTrue ^$IsEmpty("^$GetLine$")$ NEXT ELSE SKIP_2
^!Keyboard DELETE
^!GoTo DumpBad

^!If "^$IsNumber("^$GetSelection$")$" = "1" SKIP
^!If "^$IsUppercase("^$GetSelection$")$" = "1" SKIP_4
^!Select Eol
^!Keyboard DELETE
^!Keyboard DELETE
^!GoTo DumpBad

:GoNext
^!Jump +1
^!GoTo DumpBad

; following is to eliminate single characters on one line
:Sort2
^!Jump 1

:Sort2a
^!Select Eol
^!IfError END
^!If ^$StrSize("^$GetSelection$")$ > 1 SKIP_2
^!Keyboard DELETE
^!Keyboard DELETE
^!Jump +1
^!GoTo Sort2a

This also removes any single character lines (under the theory those aren’t words).

Significant things done in this clip:
generating a list of words by replacing most non-alphanumeric with a space
replacing all double spaces with a single space and a return
sorting of the words that are now on single lines using the function in notetab
elimate all lines that don’t have an uppercase letter as the first character (note that we needed to use the test clip info to be sure that ^!IsUppercase was alphabetic before testing if it was upper case)
remove lines with only one character on them

Generate Random List of CSV Field Data

November 29, 2004 on 4:16 am | In Special Clips - for someone | No Comments

This clip will take a selection of data contained in a comma separated file (without quotes) and reorder those fields in a random fashion.

Continue reading Generate Random List of CSV Field Data…

Calculate Splits for a 5 Kilometer Race

November 29, 2004 on 3:55 am | In General, Special Clips - for someone | No Comments

I regularly have to create target splits for a five kilometer (5K or 5,000 Meter) race. This clip creates even mile splits based upon a target finish time. Continue reading Calculate Splits for a 5 Kilometer Race…

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^

Bad Behavior has blocked 363 access attempts in the last 7 days.