问题
I have a text file that is | delimited and is over 59,000 line long. How can I remove the carriage returns so each line is one record?
Here is what the current file looks like:-
Here is what I need it to look like:-
Any help would be awesome
回答1:
Do a regular expression find/replace like this:
- Open Replace Dialog
- Find What:
[^|\n\r]\R
- Replace With:
\1
- check regular expression
- click Replace or Replace All
It matches OS-linebreaks (\R
) that are not (^
) preceded by a |
or \r
or \n
. Should work with any EOL convention.
来源:https://stackoverflow.com/questions/38758450/remove-carriage-return-from-text-file