- Replace every space inside of a string with a null character. Regex:
(".*")to capture a string. - Split text by newline
- Split each line by space:
\s+ - Replace every null character with a space and written
\nwith an actual newline. - Remove any blank lines