I need to combine every 5 lines into 1. I have a wordlist dictionary which contains 1000 lines example:
line 1
line 2
.
line 1000
I need to combine every 5 lines:
line 1 line 2 line 3 line 4 line 5
.
line 996 line 997 line 998 line 999 line 1000
^(.+)\R(.+)\R(.+)\R(.+)\R
$1 $2 $3 $4
. matches newline
Explanation:
^ : beginning of line
(.+) : group 1, 1 or more any character
\R : any kind of line break
: same pattern occurs 4 times.
Replacement:
$1 : content of group 1
: a space
: same for other groups