Here is an option using sed
:
$ cat file
X00000;111111;1111111111;This is just a text
X00000;111111;1111111111;This is a longer text which contains a
new line sign.
X00000;111111;1111111111;"This is a longer text which contains a
new line sign
or even more
or a line that even contains only a new line sign
"
$ sed ':a;$bc;N;s/\n/ - /;ba;:c;s/ - X00000;/\nX00000;/g' file
X00000;111111;1111111111;This is just a text
X00000;111111;1111111111;This is a longer text which contains a - new line sign.
X00000;111111;1111111111;"This is a longer text which contains a - new line sign - or even more - - or a line that even contains only a new line sign - - "
Explanation:
sed '
:a # Create a label a
$bc # If it is last line, branch to label c
N # Append next line to pattern space
s/\n/ - / # Remove the \n and replace it with -
ba # Keep repeating above steps until file is complete
:c # Our label c. Do the following when end of file is reached
s/ - X00000;/\nX00000;/g # We do this substitution to add newlines where needed.
' file