4
4
4upik2022-03-01 11:03:15
Regular Expressions
4upik, 2022-03-01 11:03:15

How to automatically remove the transition to a new line in some parts of the text?

We copy the characteristics of the product from someone else's site to our site (the sites are different, the problem is the same)
when copy-pasting is inserted like this: (the donor site has its own html and css tags)


Appliance

type Type
Showcase

Dimensions

Dimensions (H*W*D)
195*60*61 cm
Height
195 cm
Width
60 cm
Depth
61 cm
Varies Data
155
Varies Data
text



Is it possible to automate this using Notepad++ or other editors, for example using regular expressions or advanced replacement, to get text like this:


Appliance

type Type: Showcase

Dimensions

Dimensions (H*W*D): 195*60*61 cm
Height: 195 cm
Width: 60 cm
Depth: 61 cm
Varies Data: 155
Varies Data : text


Those. if there is an empty line after the line, then wrap its contents in some tag.
And the lines where the next line is not empty, combine by putting a sign after the top line:

Something like that, I myself am a little familiar with regular expressions, but I have never worked on lines.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question