Linebreak after text with number in different lengh
-
Hello folks
I don’t find a solution for my problem, so sorry for asking here.
Input:
I have a csv-file (Windows CR LF) with normally about 40k rows, but they are all in one line. I want to add a linebreak after ever B12345 and V12345. The number length could variate. I have ; as separator and have added “” to every entry between the separator.Input example:
“B1000037”;“testtext”;“test / text”;“V1234”;“testtext2”;“test / text”;Expected outcome:
“B1000037”;“testtext”;“test / text”;
“V1234”;“testtext2”;“test / text”;Main reason:
I have a csv with linebreaks from an editor and excel can’t handle this to know that is the above line because of the LF. So i had to change the rows to one line and re-linebreak them at the right position so that excel can handle them well.Tested replace from my side:
I have tested the following rule:Find what: "B[\d{1,9}] Replace with: \r\nOutcome of my own test:
It works with the linebreak but it always kills the first 2 chars like:
“000037”;“testtext”;“test / text”;
“234”;“testtext2”;“test / text”;I hope this is enough info and i’m hoping for an answer here. It could also be in two steps.
Greetings, Andi
-
@Andi You want:
Find what :
;("[BV]\d++";)
Replace with :;\r\n\1 -
@Coises That worked perfectly, many thx for the fast response. Have a nice day.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login