




已阅读5页,还剩14页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
UE宏命令自动批处理替换文本免费下载在文本编辑过程中,经常有某项工作要多次重复(如连续遍历N次替换文本),这时可以利用UE的宏功能来使其自动执行,以提高效率。宏是将一系列的UE命令和指令组合在一起,形成一组“批处理”命令,以实现任务执行的自动化。1.“宏”菜单“录制”在弹出的对话框中设定快捷键。 2.如作查找替换操作,把替换窗口关掉。 3.在“宏”菜单,选“停止录制”。关闭UE时间会提示是否保存宏。4.宏”菜单,选“自动加载宏”,设置每次启动自动加载指定宏,只要启动了UE按下快捷键(如Ctrl+M),即自动批处理。解释版(录制后将得到如下类似宏,但没有此处复杂):*Mode /使用*模式ColumnModeOff /关闭列模式HexOff /关闭十六进制模式Find RegExp interface Port-channel?/使用正则表达式查找关键字,关键字格式为:/行首以interface Port-channel打头的,后面的?表示匹配除换行符外的任一单个/字符,因为可能是Port-channel1也可能是Port-channel2,所以用?表示IfFound /若找到Key RIGHT ARROW/光标向右移一个字符Start* /开始选择Loop 4 /循环4次Key RIGHT ARROW/也就是向右移动4个字符EndLoop End* /选择4个字符,也就是VLAN IDCopy /复制VLAN ID到剪贴板Key DOWN ARROW /向下移动两行Key DOWN ARROWKey HOME /光标移到行首encapsulation dot1Q /输入encapsulation dot1Q ,注意后有个空格Paste /复制剪贴板中的VLAN ID到dot1Q后面,从而实现VLAN ID的复制 /两行的双引号,实现换行EndIf如做查找替换文本,以上录制时第一步请先按Ctrl+Home将光标定位到第一行行首,查看宏可以看到增加了Top命令,这在自动批处理替换过程相当重要,至于作用自己去悟,先不要这么做失败了再去这么做了我想你会感谢我。附:本文作者fashio7752的百度知道相关回答:ue中的$如何去掉/question/231444929.html?oldq=1技巧版:1. UE里面替换tab键为空格 解决使用UE编辑好且排列整齐的文件在EditPlus中错位的问题。 对于已有的带有tab键的空格,若需要将tab键转换为空格,可使用如下方法: 1)使用查找替换功能(Ctrl+R),t 表示tab,在出现的窗口中的“查找(N)”输入:t ,“替换为(P)”输入四个空格,全部替换即可。 2)中文是 工具栏“格式”-“转换制表符为空白” 英文是 工具栏“ format”-“tab to spaces”。 若要使新建的文件在UE中编辑时,键入tab键时为4个空格,可选择工具栏选择“高级”-“配置”,勾选“用空格代替制表符”,并将缩进的空 格由2改成4即正则表达式 ( Syntax):% 匹配行首 - 表明要搜索的字符串一定在行首.$ 匹配行尾 - 表明要搜索的字符串一定在行尾? 匹配除换行符外的任一单个字符.* 匹配任意个数的字符出现任意次数(不包括换行符)+ 匹配前导字符或者表达式出现一次或者更多次(不包括换行符)+ 匹配前导字符或者表达式不出现或者出现一次以上(不包括换行符)b 匹配页中断符p 匹配DOS文件的换行符r 匹配MAC文件的换行符(CR Only)n 匹配UNIX文件的换行符 (LF Only)t 匹配一个制表符 匹配方括号中的单个的字符删除空行: 替换 % t+p 为 空串删除行尾空格: 替换 t+$ 为 空串删除行首空格: 替换 % t+ 为 空串每行设置为固定的4个空格开头: 替换 % t+( tp) 为 1每段设置为固定的4个空格开头: 替换 % t+ 为 (如果一行是以空格开始的,则视之为一段的开始行)将一段合并为一行: 替换 t+p( tp) 为 1(注意: 此处假定文本是以DOS方式回车换行 - CR/LF)去掉HTML TAG: 替换 为 空串删除HTML中的所有: 替换 为 空串删除文本中指定的前2列字符: 替换 %? 为 空串在第4列后插入2列空白字符: 替换 %(?)(?) 为 1 2查找所有的数字: 0-9+.+0-9+查找所有的单词: a-z+查找所有的网址: http:/a-z0-9_./-?=&+UltraEdit 宏编辑命令汇总UltraEdit 10.0 帮助文件Edit Macro (Macro menu)The Edit Macro command allows a new macro to be created and edited or an existing macro that has previously been generated with this command or with the Macro Record command to be edited.In many cases, it is easier for the user to generate the macro by recording it with the Macro Record command and then to edit it if necessary. The learning curve is less with this approach.CommandsA macro is a series of commands that may later be played back automatically to modify the file. The left hand side of the dialog shows the current macro being edited and an editable window containing the commands that make up the macro.The commands in the macro must be one of the predefined commands. These predefined commands are shown on the right hand side of the dialog. If the mouse is double clicked on the command it is automatically added to the macro, or clicking on the arrow to the left of the commands will add it to the macro.ParametersMany of the commands have numeric parameters. The numeric parameters are quite obvious, such as Goto Line # or Goto Page #. However, some of the commands such as Find and Replace, Sort etc. have additional parameters that are not numeric. These additional parameters are listed below the command list for easy selection.Creating a New MacroTo create a new macro from this dialog click the New/Macro button. This displays the Macro Definition dialog allowing you to define the macro name and hot key if required.When this new macro is created, three macro commands are automatically added to the macro:- Insert Mode or OverStrike Mode- ColumnModeOn or ColumnMode Off- HexOn or HexOffThese three commands are added based on the current state of the editor. The purpose is to establish a known state each time the macro is played. If a macro is recorded in one mode and played back in another the results may be unpredictable. Establishing the mode at the beginning of the macro helps to ensure the expected results are achieved. These commands may be modified as required.Once an edit macro has been created, it may be edited.Modifying The MacroTo modify the macro, commands may be typed directly into the macro edit box or selected from the command list. Commands are not case sensitive but must be spelled exactly as shown in the command list.The table below shows the commands that may be added to any parameters:CommandsParameters*Description1. Insert text between the quotes (). The closing 2. quote must be the last non-space character on the line. The characters to 3. be inserted may cross multiple lines. To insert a quote (), place it as 4. needed in the text being inserted and ensure the last character is also a 5. quote. To insert just one quote character () the line should look like 6. this:To insert a new line, add a line between the open quote and close 7. quote. To insert two lines with 1 and 2 at the beginning of the lines the 8. command should be as follows:9. 110. 211.12.13. AnsiToOemConvert file from ANSI to OEM.14. 15.16. BottomJump to end of file.17. 18.19. CloseFileBlank (no parameter),Save - forces the file to be 20. saved before closingNoSave ?closes the file without prompting if the file 21. should first be savedClose the active file.22. 23.24. ClearClipboardClear the contents of the active 25. clipboard within UltraEdit.26. 27.28. ClipboardClipboard number (0-9)Select the specified 29. clipboard ?0 = Windows Clipboard and 1-9 specifies user clipboards.30. 31.32. ColumnCenterJustifyCenter justify selected columns.33. 34.35. ColumnLeftJustifyLeft justify selected columns.36. 37.38. ColumnRightJustifyRight justify selected columns.39. 40.41. ColumnModeOffTurn the column mode off.42. 43.44. ColumnModeOnTurn the column mode on.45. 46.47. ColumnCutCut selected columns in column mode.48. 49.50. ColumnDeleteDelete selected columns in column mode.51. 52.53. ColumnInsertString in quotes ()Insert string between quotes54. into selected columns.55. 56.57. ColumnInsertNumstart numberincrementLeadingZero (optionally)58. Insert number in selected columns.59. 60.61. CopyCopy selected text to the clipboard.62. 63.64. CopyAppendCopy selected text and append it to the 65. clipboard.66. 67.68. CopyFilePathCopy the active file path/name to the 69. clipboard.70. 71.72. CutCut the selected text from the file to the clipboard.73. 74.75. CutAppendCut the selected text from the file and 76. append it to the clipboard.77. 78.79. DeleteDelete current character or selected text.80. 81.82. DeleteLineDelete the current line.83. 84.85. DeleteToEndofLineDelete from the current cursor 86. position to the end of the line.87. 88.89. DeleteToStartofLineDelete from the current cursor 90. position to the start of the line.91. 92.93. DosToMacConvert the file (line terminators) to MAC 94. format.95. 96.97. DosToUnixConvert the file (line terminators) to UNIX 98. format.99. 100.101. ElseElse function for an IF?command.IfSel匛lsedo these 102. commands if the IfSel failed.Endif103. 104.105. EndIfEnds the block of instructions controlled by106. the IfFound/IfNotFound statements.107. 108.109. EndLoop End of loop - go back to beginning of the 110. loop - see the Loop command.111. 112.113. EndSelectStop Selecting Text (see Start Select for 114. details).115. 116.117. ExitLoop Exit loop and go to first command after the 118. loop (after the EndLoop command) - see the Loop command.119. 120.121. ExitMacro Exit Macro without processing any additional122. commands or returning an error.123. 124.125. Find (Search string in quotes)MatchCase ?indicates the search 126. is case sensitive (optional)MatchWord - indicates the search string will 127. only match instances that are a complete word (optional)RegExp - Indicates a128. Regular Expression search (optional)Up - Indicates search in reverse 129. direction (optional)Select ?Indicates the text should be selected from the 130. current selection/position to the end of the search target.Find the 131. string in quotes based on the parameters specified.132. 133.134. GetStringString in quotes () used in the prompt dialog135. Prompts the user for a string that is inserted in the file at the current 136. location. The prompt is the prompt or question that is displayed to the 137. user when the macro is run.GetString Where country do you live in?138. 139.140. GetValueString in quotes () used in prompt dialog141. Prompts the user for a value that is inserted in the file at the current 142. location. The prompt is the prompt or question that is displayed to the 143. user when the macro is run.GetValue How old are you? 144. 145.146. GotoBookMarkJump to the next bookmark.147. 148.149. GotoBookMarkSelectJump to the next bookmark and select150. text from cursor position to bookmark.151. 152.153. GotoLineNumeric value of line number to jumpJump to 154. specified line number.155. 156.157. GotoLineSelectNumeric value of line number to jumpJump158. to specified line number and select text from cursor position to line.159. 160.161. GotoPageNumeric value of page to jumpJump to specified 162. page number.163. 164.165. GotoPageSelectNumeric value of page to jumpJump to 166. specified page number and select text from cursor position to page number.167. 168.169. HexDeleteNumeric value specifying number of bytes to delete170. Delete the specified number of bytes from the file.171. 172.173. HexInsertNumeric value specifying number of bytes to insert174. Insert the specified number of bytes into the file.175. 176.177. HexOffTurn Hex mode off - switch to text mode.178. 179.180. HexOnTurn Hex mode on.181. 182.183. HideOrShowLinesHide the selected lines, or if 184. hidden, show the lines hidden at the line of the cursor.185. 186.187. IfCharGtcharacter or number.This checks if the current 188. character at the cursor position is greater than the specified character or 189. number specified. The check against a number is not to check the value of a190. string but the value of the underlying character.IfCharGt ?do these 191. commands if the current character is greater than a space.匛ndIfIfCharIs 32?192. do these commands if the current character抯 decimal value is greater than 193. 32 - a space.匛ndIf194. 195.196. IfCharIsstring or number.This checks if the current character197. at the cursor position is in the specified string, or matches the decimal 198. number.IfCharIs xyz?do these commands if the current character is x, y, or199. z.匛ndIfIfCharIs 34?do these commands if the current character is decimal 200. value 34 - a double quote.匛ndIf201. 202.203. IfColNumnumber.This checks if the current cursor position 204. is the specific column number.IfColNum 10?do these commands if the current 205. cursor position is column 10. Column 1 is the first column.匛ndIf206. 207.208. IfColNumGtnumber.This checks if the current cursor position 209. is greater than the specific column number.IfColNumGt 10?do these commands 210. if the current cursor position is greater than column 10. Column 1 is the 211. first column.匛ndIf212. 213.214. IfEofThis checks if the current cursor position 215. is at the end of file.IfEof?do these commands if at end of file匛ndIf216. 217.218. IfExtIsstring.This checks if the file extension of the 219. active file matches the specified string. If the extension matches, the 220. condition is satisfied and the macro will execute the steps following the 221. IfextIs statement.IfExtIs txt?do these commands if the current file 222. extension is txt.匛ndIf223. 224.225. IfFoundThis checks the results from the last find 226. command in the macro and will execute the next set of instructions up to an 227. EndIf if the last search was successful:Find somethingIfFound?do these 228. commands if something was found匛ndIfNOTE - To avoid a Not Found message229. when running the macro, make sure the Continue if a Find with Replace Not 230. Found check box is set for the macro properties.231. 232. 233.234. IfFTPThis checks if the current file is a file 235. loaded via FTP/SFTP and not a local/network file.IfFTP?do these commands if236. the file is an FTP loaded file匛ndIf237. 238.239. IfNameIsstring.This checks if the active filename (not path240. or extension) matches the specified string. If the name matches, the 241. condition is satisfied and the macro will execute the steps following the 242. IfNameIs statement.IfNameIs test?do these commands if the current filename243. is test (irrespective of the file extension).匛ndIf244. 245.246. IfNotFoundThis checks the results from the last find 247. command in the macro and will execute the next set of instructions up to an 248. EndIf if the last search was NOT successful:Find somethingIfNotFound?do 249. these commands if something was NOT found匛ndIfNOTE - To avoid a Not 250. Found message when running the macro, make sure the Continue if a Find 251. with Replace Not Found check box is set for the macro properties.252. 253.254. IfSelThis checks if there is currently any 255. selected text within the active file.IfSel?do these commands if something 256. is selected匛ndIf257. 258.259. InsertModeChange text editing mode to insert mode for 260. characters typed.261. 262.263. InsertPageBreakInsert a form feed/page break 264. character at the current cursor position in the file.265. 266.267. InvertCaseInvert the case of selected text.268. 269.270. Loop xLoop x times where x is a number. A value of 0 271. indicates Loop forever.i.e.Loop 10?do these commands 10 times匛ndLoop272. 273.274. KeyBackspaceCtrl+DELDOWN ARROWENDHOMELEFT ARROWPGDNPGUPRIGHT 275. ARROWUP ARROWInsert a key command into the macro. Generally used for 276. navigation in the file and for backspace or delete. The Ctrl+ modifier 277. may be used as with normal editing to modify the command.For text input the 278. string command is used, not the Key command.279. 280.281. MatchBraceFind matching brace and select the text 282. between them.283. 284.285. NextWindowSwitch to next window.286. 287.288. NewFileOpen a new blank file.289. 290.291. OemToAnsiConvert file from OEM to ANSI.292. 293.294. OpenFilename in quotes ()Open the specified file. The 295. Filename must be in quotes. s may be used in the filename. UltraEdit 296. will replace this with the currently selected text in the active Window. 297. Likewise, c may be used and UltraEdit will replace this with the contents298. of the clipboard.299. 300.301. OverStrikeModeChange text editing mode to 302. overstrike mode for characters typed.303. 304.305. PastePaste the contents of the clipboard into the306. file.307. 308.309. PlayMacroNumeric value specifying number of times to play 310. itMacro name () in quotes.Play another macro. Specify the number of 311. times to play the macro first, then the macro name. The macro name must be 312. in quotes.313. 314.315. PreviousBookMarkJump to the previous bookmark.316. 317.318. GotoBookMarkSelectJump to the previous bookmark and 319. select text from cursor position to bookmark.320. 321.322. PreviousWindowSwitch to previous window.323. 324.325. ReplaceAll - Replace all occurrences.AllFiles - Replace in all 326. open files (requires All).Selected Text ?Replace in selected text (Requires 327. All).Replace String in quotes () - String to replace the found string.328. The Replace command replaces the previously found string with the 329. string specified. This command MUST follow a Find command.As with the Find 330. string, the replace string must be in quotes. The closing quote must be the 331. last non-space character on the line.The replace string may cross multiple 332. lines however, if the last non-space character in any line is a quote it 333. will terminate the string. All special characters permitted by the Replace 334. Command are permitted here.335. 336.337. ReturnToWrapConvert hard returns to word wrap.338. 339. 340.341. RunToolString in quotes () specifying the menu name of 342. tool to runRun a tool. The tool must be configured from Tool 343. Configuration in the Advanced menu.344. 345.346. SaveSave active file.347. 348.349. SaveAllSave all open files.350. 351.352. SaveAsFilename in quotes ()Save the active file as the 353. filename specified. The Filename must be in quotes. s may be used in the354. filename. UltraEdit will replace this with the currently selected text in 355. the a
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年特岗教师招聘考试英语教育教学能力测试模拟题
- 2025年网络安全工程师高级实战指南与题库
- 电业作业规程培训课件
- 2025年特岗教师招聘面试初中体育科目备考指南及模拟题集
- 幼儿园秋季开学返园工作方案
- 甲状腺超声造影课件
- 甲状腺正常生理功能
- 甲方工程基本知识培训课件
- 《自然选择的证明》课件
- 《空城计》教学课件
- 产品表面外观缺陷的限定标准
- (33)-钠钾泵细胞生物学
- 配电室巡检记录表
- 紧急宫颈环扎术的手术指征及术后管理
- GB/T 242-2007金属管扩口试验方法
- 政治理论水平任职资格考试题库
- 路基压实度汇总表
- 【食品生产加工技术】香肠的加工技术
- 贫困户访谈记录
- 道路喷雾降尘方案
- 唐恬人世间的孤勇者与追光者
评论
0/150
提交评论