Trim LDAP extract
-
Hello,
i need to remove every first (ex:CN=toto), from my ldap export.
its easy if there is only one.
but my extract containt sometime more.ex:
CN=toto,CN=test,DC=contoso,DC=localand then, the replace option remove every CN.
If i use the mark option, its ok, but i can’t remove marqued texte (or i dont find the option)Could you help me with that ?
Thanks :) -
Your problem statement is a bit vague, but with my interpretation of it, I would try:
Find:
\A(?s)(.*?)(?-i)CN=\w+,
Replace:${1}
Search mode: Regular expression -
@Olivier-Chantraine said in Trim LDAP extract:
i can’t remove marqued texte (or i dont find the option)
This option doesn’t exist because you can just use Replace instead.
-
@Olivier-Chantraine said in Trim LDAP extract:
Hello,
i need to remove every first (ex:CN=toto), from my ldap export.
its easy if there is only one.
but my extract containt sometime more.ex:
CN=toto,CN=test,DC=contoso,DC=localand then, the replace option remove every CN.
If i use the mark option, its ok, but i can’t remove marqued texte (or i dont find the option)Could you help me with that ?
Thanks :)Sorry, i will try to be clear,
i have a csv with multiple line (txt line)
each line start with CN=
CN=toto,CN=test,DC=contoso,DC=local
CN=tota,OU=test,DC=contoso,DC=local
CN=tata,OU=test2,DC=contoso,DC=local
CN=tAto,CN=test2,DC=contoso,DC=locali want to remove the first “CN=text,”
with option mark text, i use :^CN.*?,
and it work well (for marking only)
but , if i replace, the regex erase all “CN=text,” in the same line -
@Olivier-Chantraine said in Trim LDAP extract:
and it work well (for marking only)
but , if i replace, the regex erase all “CN=text,” in the same lineThat’s because after the substitution, the next
CN=text,
is the firstCN=text,
on the line, and it will match again.I think what you want is
FIND =(?-s)^CN=.*?,(.*)$
REPLACE =${1}
That will delete the first
CN=...,
on each line, leaving the rest of the line intact.----
Useful References
-
From the revised explanation of the problem, I can see why you liked the Mark idea (that wouldn’t work). :-)
-
@PeterJones said in Trim LDAP extract:
@Olivier-Chantraine said in Trim LDAP extract:
and it work well (for marking only)
but , if i replace, the regex erase all “CN=text,” in the same lineThat’s because after the substitution, the next
CN=text,
is the firstCN=text,
on the line, and it will match again.I think what you want is
FIND =(?-s)^CN=.*?,(.*)$
REPLACE =${1}
That will delete the first
CN=...,
on each line, leaving the rest of the line intact.----
Useful References
Ty, its working :)