Community
    • Login

    Remove " quotes from tsv file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.8k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Christopher PhillipsC Offline
      Christopher Phillips
      last edited by

      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"text

      Any ideas how I can achieve this on all files?

      1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by guy038

        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 as code text :

        Thanks for trying

        See you later,

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 0
        • Christopher PhillipsC Offline
          Christopher Phillips
          last edited by

          "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
          
          1 Reply Last reply Reply Quote 0
          • guy038G Offline
            guy038
            last edited by

            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 around option, if necessary

            • Select the Regular expression search mode

            • Click, exclusively, on the Replace All button


            Notes :

            • This search regex contains 3 alternatives, 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

            1 Reply Last reply Reply Quote 2

            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
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors