简体   繁体   中英

Notepad++ Search and Replace with Tab Delimited File

I have a file that is tab delimited. When exporting from Excel, if the cell has a comma in it, it will wrap the cell with double quotes.

To find the first double quote, I can look for a tab then double quote ex: \\t"

The next double quote to remove is at the end of the line, so I would like to find double quote then newline ex: \\n" but this is not working.

Example of the file format:

text TAB text TAB "moretextwithquotes" CRLF

First, you're searching for \\n" instead of "\\n , if I well understand your problem.

Secondly, you need to search for \\r\\n instead of \\n , so your final result should be "\\r\\n .

If all your data is consistent where double quotes are matched and encapsulates fields,
I would just do a global find and replace just on quoted text.
Replacing the match with just the field data. This strips the quotes, leaves everything
else untouched.

Find: "([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"
Replace: $1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM