With the help of REGEX I am trying to convert italian synonym database to the following format:
synonym1|synonym2|synonym3 anothersynonym1|anothersynonym2 ........... ......
At this moment I have unconverted synonyms database in this format:
a| - word |per -it's synonym |verso -another synonym of the word "a" in the second row abate| - second word |priore|superiore abbacchiare| |avvilire|deprimere abbacchiarsi| |abbattersi|abbiosciarsi|accasciarsi
Clarification: I would like to use Regular Expression to match all lines beginning with "|" (pipeline) and move them to the line above to merge with the word matching with lines ending with (Pipeline) and also moving in rows beginning with "|" (second - third - fourth lines of synonyms which may be merged together, obviously when merged lines with "ending and beginning" Pipelines one of the (Pipelines) should removed to get desired format:
Example of the converted database from unconverted database above
a|per|verso abate|priore|superiore abbachiare|avvilire|deprimere abbachiarsi|abbattersi|abbiosciarsi|accasciarsi
Can anybody help me to find exact REGULAR EXPRESSION by using function FIND and REPLACE with any text editor?