Okay, here is the macro for your need. This macro uses the UltraEdit style regular expression which is need for this macro because ^c cannot be used with Unix or Perl engine within a regular expression. If you prefer the Unix or Perl regex engine by default, insert the appropriate macro command for the engine before ExitMacro and at end of the macro.
The regular expression search string looks strange because I have restricted it as much as possible to really find the year lines. The 3 alphabetical ranges matches JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC (and some other hopefully not existing crazy letter combinations).
In comparison to the macro at
Splitting based on content only a few lines has been deleted or modified (
marked green).
The ExitMacro part after first search is for security. It avoids an execution of this macro on a wrong file.
The macro property
Continue if a Find with Replace not found must be checked for this macro.
InsertMode
ColumnModeOff
HexOff
UnixReOffBottom
IfColNum 1
Else
"
"
EndIf
Loop
GotoBookMark
IfEof
ExitLoop
Else
ToggleBookmark
Bottom
EndIf
EndLoop
Top
ToggleBookmark
Find MatchCase RegExp "%[ ^t]++254+[ ^t]+[0-9]+[ ^t]+[0-9]+[ ^t]+[ADFJMNOS][ACEOPU][BCGLNPRTVY][ ^t]+^{19^}^{20^}[0-9][0-9]"
IfNotFound
ExitMacro
EndIfClipboard 9
Key LEFT ARROW
SelectWordCopy
EndSelect
Loop
Find MatchCase RegExp "%[ ^t]++254+[ ^t]+[0-9]+[ ^t]+[0-9]+[ ^t]+[ADFJMNOS][ACEOPU][BCGLNPRTVY][ ^t]+^c"IfFound
Key LEFT ARROW
Else
Find MatchCase RegExp "%[ ^t]++254+[ ^t]+[0-9]+[ ^t]+[0-9]+[ ^t]+[ADFJMNOS][ACEOPU][BCGLNPRTVY][ ^t]+^{19^}^{20^}[0-9][0-9]"
IfFoundKey HOME
IfColNumGt 1
Key HOME
EndIf
Else
Bottom
EndIfToggleBookmark
Clipboard 8
GotoBookMarkSelect
Copy
EndSelect
ToggleBookmark
GotoBookMark
NewFile
Paste
Clipboard 9
Paste
".csv"
StartSelect
Key HOME
Cut
EndSelect
SaveAs "^c"
CloseFile
IfEof
ExitLoop
Else
Key END
Find MatchCase RegExp "%[ ^t]++254+[ ^t]+[0-9]+[ ^t]+[0-9]+[ ^t]+[ADFJMNOS][ACEOPU][BCGLNPRTVY][ ^t]+^{19^}^{20^}[0-9][0-9]"Key LEFT ARROW
SelectWordCopy
EndSelect
EndIf
EndIf
EndLoop
ToggleBookmark
ClearClipboard
Clipboard 8
ClearClipboard
Clipboard 0