Hello,
I'm fighting with a regex to fill the space between two words with spaces.
Situation:
I've a text file with approx 500 lines. Every line contains two "words", which are separated with whitespaces (one or more). The length of the first word varies from 3 to 30 character. The length of the second "word" varies from 1 to 10 characters. For better readability and maintenance purposes, the second word should start at the 40th character, regardless of whether the first word is 3 or 30 characters long. The space between the two words should be filled with white spaces.
Source format
Target format
I tried:
Find what: [^\s]*)([\s]*)([^\s]*)
Replace with: (\1 \2){40} \3
But the search expression doesn't work.
Could anyone give me a hint to solve this problem with regex?
Thanks for your support.
Manuel
I'm fighting with a regex to fill the space between two words with spaces.
Situation:
I've a text file with approx 500 lines. Every line contains two "words", which are separated with whitespaces (one or more). The length of the first word varies from 3 to 30 character. The length of the second "word" varies from 1 to 10 characters. For better readability and maintenance purposes, the second word should start at the 40th character, regardless of whether the first word is 3 or 30 characters long. The space between the two words should be filled with white spaces.
Source format
Target format
I tried:
Find what: [^\s]*)([\s]*)([^\s]*)
Replace with: (\1 \2){40} \3
But the search expression doesn't work.
Could anyone give me a hint to solve this problem with regex?
Thanks for your support.
Manuel