Remove " quotes from tsv file
-
I have a folder with hundred of tsv files.
The all follow the structure“sourcetext”(tab)“targettext”
“moresourcetext”(tab)“moretargettext”
“more”“source”“text”(tab)“more”“target”“text”I am trying to find a way to end up with:
sourcetext(tab)targettext
moresourcetext(tab)moretargettext
more"source"text(tab)more"target"textAny ideas how I can achieve this on all files?
-
Hello, christopher-phillips,
Because of Markdown syntax of this forum, some regular double-quotes (
"), in your text, may have been changed as“and”. So, could you rewrite your input and output text, using the button, below, to see it ascodetext :
Thanks for trying
See you later,
Best Regards,
guy038
-
"sourcetext"(tab)"targettext" "moresourcetext"(tab)"moretargettext" "more""source""text"(tab)"more""target""text" I am trying to find a way to end up with: sourcetext(tab)targettext moresourcetext(tab)moretargettext more"source"text(tab)more"target"text -
Hi, christopher-phillips,
Thanks ! So, here is the road map, with a regex S/R :
-
Open the Replace dialog (
Ctrl + H) -
SEARCH
(^|(?<=\t))"|"((?=\t)|$)|"(?=") -
REPLACE
Leave EMPTY -
Tick the
Wrap aroundoption, if necessary -
Select the
Regular expressionsearch mode -
Click, exclusively, on the
Replace Allbutton
Notes :
-
This search regex contains
3alternatives, separated with the alternation symbol|:-
The first part
(^|(?<=\t))"searches for a double quote, only if at beginning of line or preceded with a tabulation char (\t) -
The second part
"((?=\t)|$)searches for a double quote, only if followed with a tabulation char or an end of line -
The last part
"(?=")searches for a double quote, only if followed with a second double-quote
-
-
As the replacement zone is
Empty, the double-quote selected, whatever the alternative, is simply deleted
Best Regards,
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login