帮助循环宏或变通方法 [英] Help with looping a macro, or a workaround

查看:78
本文介绍了帮助循环宏或变通方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从我上传的Youtube视频中编辑包含导出的隐藏字幕的文档。我想要做的是连续删除约1000 x的行号和时间戳。示例文本粘贴在下面。文本中有一种模式,每4行重复
。我只想删除第1,2和4行。

I am trying to edit a document containing exported closed captions from a Youtube video I uploaded. What I am trying to do is delete a line number and time stamp about 1000 x in a row. Sample text is pasted in below. There is a pattern to the text that repeats every 4 lines. I just want to delete lines 1, 2, and 4.

我早就知道宏,但没有使用它们的经验,或任何类型的编码。然而,我能够录制一个宏,它可以做我想做的事情,这真的激起了我的兴趣。我遇到的麻烦是
为了清理整个文档,每次我想运行宏时都要点击鼠标按钮。其次,由于某些原因,经过这么多点击后,光标将会在与我录制宏时不同的位置结束,导致
模式歪斜。

I have long known about macros, but have zero experience using them, or any type of coding for that matter. However, I was able to record a macro that does what I would like it to do, and that really piqued my interest. The trouble I have run into is that in order to clean up the whole document, I have to click a mouse button every time I want to run the macro. Secondly, for some reason after so many clicks, the cursor will end up in a different place than where it was when I recorded the macro, causing the pattern to go askew.

我在这里搜索了论坛并了解了循环,但我无法弄清楚如何循环我的特定宏。我也看到有人建议使用通配符查找/替换作为对我的类似查询的解决方案的响应,但是我是
无法将其转换为我的问题。这导致我想要创建自己的主题,并提出一个宏是否是我需要的问题,或者是否有其他解决方法来实现这个简单的编辑。 

I've searched the forums on here and learned about looping, but I wasn't able to figure out how to loop my specific macro. I also saw a response from someone who suggested a wildcard find/replace as a solution to a similar inquiry to mine, however I was not able to translate that to my problem. This led me to want to make my own thread, and pose the question of whether a macro is even what I need, or if there is some other workaround to achieve this simple edit. 




这是我使用按键记录的宏:

以下是文字示例我正在使用: 

推荐答案

根据您的描述,您应该能够通过
获得所需的结果通配符查找/替换,其中:

查找=  ^ 13 [0-9] @ ^ 13 [0-9] @:[0-9] @ * ^ 13(* ^ 13) * ^ 13

替换= ^ p \ 1

Find = ^13[0-9]@^13[0-9]@:[0-9]@*^13(*^13)*^13
Replace = ^p\1

无需宏,如果您经常这样做,可以将上述内容记录为宏。

No macros required, though you could record the above as a macro if you're doing this often.

注意:您的样本中哪些线条构成1,2不明显&安培; 4,所以我不得不猜测。

Note: It's not apparent from your sample what lines constitute 1, 2 & 4, so I've had to guess.


这篇关于帮助循环宏或变通方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆