Reputation: 476
I have a CSV
file containing thousands of rows. Each line is delimited by a semi-colon(;)
, starting with character <--
and ending with character -->
. For example like this:
<--;2016;computer printer scaner;
Computer hardwares;-->
<--;2015;computer printer
scaner;Computer hardwares;-->
<--;2014;computer
printer
scaner;Computer hardwares;-->
I want to edit it so it looks like this:
<--;2016;computer printer scaner;Computer hardwares;-->
<--;2015;computer printer scaner;Computer hardwares;-->
<--;2014;computer printer scaner;Computer hardwares;-->
Usually I do it manually one by one as many as thousands of lines. Thank you very much
Upvotes: 0
Views: 43
Reputation: 91385
It could be done in 1 pass, using lookbehind.
This will replace all linebreaks that is not after the string -->
(?<!-->)\R
EMPTY
Explanation:
(?<!-->) : negative lookbehind, make sure we don't have "-->"
\R : any kind of line break
Result for given example:
<--;2016;computer printer scaner;Computer hardwares;-->
<--;2015;computer printerscaner;Computer hardwares;-->
<--;2014;computer printerscaner;Computer hardwares;-->
Upvotes: 0
Reputation: 882
in notepad++
go to find and replace. find all instances of \r and \n and replace with nothing (make sure search mode is set to extended)
find --> and replace with -->\n
that should display as your example
Upvotes: 1