
Eu tenho os seguintes enormes dados aleatórios
1231286234|453|1234|xxx|aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
1231286234|453|1234|xxx| aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
1231286234|453|1234|xxx |aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
1231286234|453|1234|xxx | aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
as linhas são enormes e os dados são aleatórios, quero que sejam assim
1231286234|453|1234|xxx aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
1231286234|453|1234|xxx aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
1231286234|453|1234|xxx aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
1231286234|453|1234|xxx aabbc|xcvxcvxcv|xcvxcvxcv|Xcvxcvxcv
Responder1
Isso funciona para a amostra que você forneceu.
Find what: (\w*\|\w*\|\w*\|\w*)([\|\s]*)([\w\|]*)
Replace with: \1 \3
Search mode: Regular expression
Responder2
- Ctrl+H
- Encontre o que:
^(?:[^|]+\|){3}.*?\K\h*\|\h*
- Substitua por:
<-- um espaço
- VERIFICAR Envolver em torno
- VERIFICAR Expressão regular
- DESMARCAR
. matches newline
- Replace all
Explicação:
^ # beginning of line
(?: # start non capture group
[^|]+ # 1 or more non pipe
\| # a pipe, have to be escaped as it's special character for regex
){3} # end group, must appear 3 times
.*? # 0 or more any character but new line, not greeedy
\K # forget all we have seen until this position
\h* # 0 or more horizontal spaces
\| # a pipe, have to be escaped as it's special character for regex
\h* # 0 or more horizontal spaces
Captura de tela (antes):
Captura de tela (depois):