V
V
vadim622018-10-11 09:19:57
Regular Expressions
vadim62, 2018-10-11 09:19:57

How to remove all text between certain characters in notepad++?

I have a semi-colon delimited csv file.
Example:
Description1 | Code1;Description2 | Code2;Description3 | Code3;Description4 | Code4;
Tell me how to remove the description (including spaces) and leave only the codes separated by a semicolon?
Those. you need to delete all text starting from the "semicolon" symbol and ending with the " | " symbol.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-10-11
@vadim62

Press Ctrl + H
Search mode: regular. expressed.
find in the field:

;[^\|]*\|

in the replacement field, what we change to, a space, for example,
then manually remove the description at the beginning and a semicolon at the end

A
AngReload, 2018-10-11
@AngReload

I don't have Notepad++ installed, but I think it's like this: replace the
regexp (^|;).*\|with (how are the groups indicated in the notepad?) \1or$1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question