How to remove quotes on lines with notepad?



  • Hello
    I need your help

    “ABIGAIL”:“17”
    “OLIVER”:“phone@”
    EVELYN:“news”
    ELIJAH:“Jackson”
    “AMELIA”:“23.5”
    “MASON”:“street”

    change to this:

    “ABIGAIL”:17
    “OLIVER”:phone@
    EVELYN:news
    ELIJAH:Jackson
    “AMELIA”:23.5
    “MASON”:street

    How could I do it?
    Thank you



  • Use search and replace in regular expression mode:

     Search: ^([^:]+):"([^"]+)"
    Replace: \1:\2
    

    The parts of the search regular expression are:

    1)  ^         Look for the beginning of a line.
    2)  ([^:]+)   Capture the set of all characters that are NOT a :
    3)  :"        Find :"
    4)  ([^"]+)   Capture the set of all characters that are NOT a "
    5)  "         Find "
    

    The replace expression replaces what the search matched with the first set of captured text \1, a colon :, and the second set of captured text \2.



  • @Jim-Dailey said:

    Search: ^([^:]+):"([^"]+)"
    Replace: \1:\2

    friend thanks, but I’ve tried it but it does not work, 0 occurrences were replaced



  • Your data showed “smart quotes” (curly quotes), but @Jim-Dailey’s regex assumed regular quote marks " – probably because many normal quotes get changed into smart quotes when being posted to this forum, and he probably assumed yours were really normal quotes.

    Is you actual data with smart quotes or normal quotes?



  • @jamie-rol said:

    ^([^:]+):"([^"]+)"

    Good afternoon, Mr. PeterJones, I have a data of 50000 lines and I need to delete the quotes after “:”, it must be smart quotes
    thanks for the interest



  • @jaimie-rol, Good Morning (timezones are funny)

    So, @Jim-Dailey did an excellent job of explaining his regex. Based on his ^([^:]+):"([^"]+)", here are the steps I would take:

    1. I want the first quote in the regex to match an opening smart quote, instead of a normal quote. So let me try changing that character: ^([^:]+):“([^"]+)"
    2. I want the final quote in the regex to match an closing smart quote, instead of a normal quote. So let me try changing that character: ^([^:]+):“([^"]+)”
    3. Jim said that the middle section indicated “all characters that are not a [normal quote]”. Since I now want to find all characters that are not a closing smart-quote, let me try changing that character: ^([^:]+):“([^”]+)”
    4. I think that makes sense. Let’s try running it.

    When I try that final regex on the exact data you posted, I get what I believe you want out.

    Let us know whether this works for you or not. If not, study this post for hints on how to format the data so it comes across without being edited, so we know exactly the data you have.

    FYI: if you have further regex needs, study this FAQ and the documentation it points to. Before asking a new regex question, understand that many of us will expect you to show what data you have (exactly), what data you want (exactly), what regex you already tried (to show that you’re showing effort), why you thought that regex would work (to prove it wasn’t just something randomly typed), and what data you’re getting with an explanation of why that result is wrong. When you show that effort, you’ll see us bend over backword to get things working for you.



  • Thank you Mr. PeterJones


Log in to reply