删除复制两行Imacros时写的[EXTRACT] [英] Delete [EXTRACT] written when copying two lines Imacros

查看:142
本文介绍了删除复制两行Imacros时写的[EXTRACT]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

adress1
adress2

如上所述复制和粘贴两行文本时.

When copying and pasting two lines of text as above.

adress1[EXTRACT]adress2

但是我想如下粘贴.请教我.

But I would like to paste this as below. Please teach me.

adress1
adress2

我正在使用: 铬70.0.3538.102 Win10_x64 imacros10.0.5forCR(免费)

I am using: Chrome 70.0.3538.102 Win10_x64 imacros10.0.5forCR (free)

推荐答案

是的,iMacros进行多次提取时,将使用此[EXTRACT]分隔符将其分离,即在将内容保存为.CSV时, "SAVEAS"命令将转换为".CSV"分隔符,通常是逗号.

Yep, when doing several Extracts, iMacros will separate them using this '[EXTRACT]' Separator, that when saving the Content to a '.CSV' using the 'SAVEAS' Command, will be converted to the '.CSV' Separator, usually a Comma.

通常使用'EVAL()'+'replace()' ,您可以将其替换为所需的任何内容...
我喜欢使用"split()"而不是"replace()",就像我在上一个Qt中已经提到的那样,以实现等效于全局"replace()"(这需要REGEX),并且甚至可以继续工作如果您有两个以上的地址...:

Using 'EVAL()' + 'replace()' usually, you can replace it with whatever you want...
Instead of 'replace()', I prefer to use 'split()' like I had already mentioned in your previous Qt to achieve the Equivalent to a Global 'replace()' (that would require REGEX) and that will keep working even if you have more than 2 Addresses...:

SET !EXTRACT adress1[EXTRACT]adress2
SET !VAR1 EVAL("var s='{{!EXTRACT}}'; var z=s.split('[EXTRACT]').join('<BR>'); z;")
PROMPT EXTRACT:<BR>_{{!EXTRACT}}_<BR><BR>Addresses:<BR>_{{!VAR1}}_

(在iMacros上针对FF v8.8.2,Pale Moon v26.3.3(= FF47),Win10_x64进行了测试.)

(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10_x64.)


并包括"#EANF#"(xN)的大小写以及在任何位置=>参见"PROMPT"中!VAR2"的内容:


And to include the Case of '#EANF#' (xN) and in any Position => See Content of '!VAR2' in the 'PROMPT':

'SET !EXTRACT adress1[EXTRACT]adress2
'SET !EXTRACT #EANF#[EXTRACT]adress2
'SET !EXTRACT adress1[EXTRACT]#EANF#
'>
'SET !EXTRACT address1[EXTRACT]address2[EXTRACT]address3
'SET !EXTRACT #EANF#[EXTRACT]address2[EXTRACT]address3
'SET !EXTRACT address1[EXTRACT]#EANF#[EXTRACT]address3
SET !EXTRACT address1[EXTRACT]address2[EXTRACT]#EANF#

SET !VAR1 EVAL("var s='{{!EXTRACT}}'; var z=s.split('[EXTRACT]').join('<BR>'); z;")
SET !VAR2 EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('#EANF#[EXTRACT]').join(''); y=x.replace('[EXTRACT]#EANF#',''); z=y.split('[EXTRACT]').join('<BR>'); z;")
PROMPT EXTRACT:<BR>_{{!EXTRACT}}_<BR><BR>Addresses_VAR1:<BR>_{{!VAR1}}_<BR><BR>Addresses_VAR2:<BR>_{{!VAR2}}_

(在iMacros上针对FF v8.8.2,Pale Moon v26.3.3(= FF47),Win10_x64进行了测试.)

(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10_x64.)

请注意,对于'y'使用'replace()',我也可以再次使用'split().join()',但是除了最终的'#EANF#'以外,其他所有内容都应该已经得到处理".通过"x"部分,那么简单的"replace()"就足够好"来处理最后一个"#EANF#".

Notice the use of 'replace()' for 'y', I could have used 'split().join()' again also but all but an eventual final '#EANF#' should have already been "handled" by the 'x' part, then a simple 'replace()' is "good enough" to handle that last '#EANF#'.

查看并重新激活所有的"SET!EXTRACT"行,以测试#EANF#"的不同案例和不同可能位置.

See and reactivate all 'SET !EXTRACT' Lines to test different Cases and different possible Positions for '#EANF#'.

这篇关于删除复制两行Imacros时写的[EXTRACT]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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