by Mofi » Tue Oct 26, 2004 9:44 am
Here is the mega macro for reformating your data. Remove the green comments, which are just for better understandig, what the macro does.
I have not really understood the numbering of barx.gif. The macro numbers it bar1.gif, bar2.gif, ..., bar12.gif, bar1.gif, bar2.gif, ..., bar12.gif, bar1.gif, .... Hope, this is what you want.
Tip for all users writing big macros: Do it step by step. Every comment was a stand-alone developed and testet macro on the execution result of the macros before. Replace the comments by command "ExitMacro" to see what is really going on during execution and remove ExitMacro step by step.
InsertMode
ColumnModeOff
HexOff
UnixReOff
Comment: Copy whole file to new file
SelectAll
Copy
EndSelect
Top
NewFile
Paste
Comment: Make sure, that last line is an empty line and trim trailing spaces.
Bottom
IfColNum 1
Else
"
"
EndIf
Top
TrimTrailingSpaces
Comment: Remove unwanted data.
Find RegExp "%robot-id*^p"
Replace All ""
Find RegExp "%robot-owner-email*^p"
Replace All ""
Find RegExp "%robot-status*^p"
Replace All ""
Find RegExp "%robot-purpose*^p"
Replace All ""
Find RegExp "%robot-type*^p"
Replace All ""
Find RegExp "%robot-availability*^p"
Replace All ""
Find RegExp "%robot-exclusion*^p"
Replace All ""
Find RegExp "%robot-exclusion*^p"
Replace All ""
Find RegExp "%robot-noindex*^p"
Replace All ""
Find RegExp "%robot-host*^p"
Replace All ""
Find RegExp "%robot-from*^p"
Replace All ""
Find RegExp "%robot-history*^p"
Replace All ""
Find RegExp "%robot-environment*^p"
Replace All ""
Find RegExp "%modified-date*^p"
Replace All ""
Find RegExp "%modified-by*^p"
Replace All ""
Comment: Convert multi-line descriptions to single-line descriptions.
Find "robot-description"
IfFound
Key HOME
Key DOWN ARROW
Loop
IfCharIs 32
Key BACKSPACE
Key HOME
Key DOWN ARROW
Else
Find "robot-description"
IfFound
Key HOME
Key DOWN ARROW
Else
ExitLoop
EndIf
EndIf
EndLoop
EndIf
Top
Comment: Reformat data with only 1 search and replace.
Find RegExp "robot-name:[ ]++^(*^)^probot-cover-url:[ ]++^(*^)^probot-details-url:[ ]++^(*^)^probot-owner-name:[ ]++^(*^)^probot-owner-url:[ ]++^(*^)^probot-platform:[ ]++^(*^)^probot-useragent:[ ]++^(*^)^probot-language:[ ]++^(*^)^probot-description:[ ]++^(*^)^p"
Replace All "(000, '^1', '^7', '^2', '^3', '^4', '^5', '^6', '^8', '^9', '', 'images/statistik/spider/^1.gif', 'images/statistik/barx.gif', 0),^p"
Top
Comment: Numbering lines.
Key RIGHT ARROW
ColumnModeOn
SelectToBottom
StartSelect
Key Ctrl+END
Key Ctrl+RIGHT ARROW
Key Ctrl+RIGHT ARROW
Key Ctrl+RIGHT ARROW
Key Ctrl+RIGHT ARROW
Key Ctrl+UP ARROW
ColumnInsertNum 1 1 LeadingZero
ColumnModeOff
Top
EndSelect
Comment: Numbering barx.gif.
Loop
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"1"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"2"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"3"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"4"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"5"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"6"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"7"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"8"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"9"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"10"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"11"
Else
ExitLoop
EndIf
Find MatchCase "barx.gif"
IfFound
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key LEFT ARROW
Key BACKSPACE
"12"
Else
ExitLoop
EndIf
EndLoop
Top