Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9187119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:41:40+00:00 2026-06-17T19:41:40+00:00

I’ve got a CSV file with some 600 records where I need to replace

  • 0

I’ve got a CSV file with some 600 records where I need to replace some [CRLF] with a [space] but only when the [CRLF] is positioned between two [“] (quotation marks). When the second [“] is encountered then it should skip the rest of the line and go to the next line in the text.

I don’t really have a starting point. Hope someone comes up with a suggestion.

Example:

John und Carol,,Smith,,,J.S.,,,,,,,,,,,,,+11 22 333 4444,,,,,"streetx 21[CRLF]
New York City[CRLF]
USA",streetx 21,,,,New York City,,,USA,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Normal,,My Contacts,[CRLF]

In this case the two [CRLF] after the first [“] need to be replaced with a space [ ]. When the second [“] is encountered, skip the end of the line and go to next line.

Then again, now on the next line, after the first [“] is encountered replace all [CRLF] until the second [“] is encountered. The [CRLF]s vary in numbers.
In the CSV-file the amount of commas [,] before (23) and after (65) the 2 quotation marks [“] is constant.

So maybe a comma counter could be used. I don’t know.

Thanks for feedback.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:41:41+00:00Added an answer on June 17, 2026 at 7:41 pm

    This will work using one regex only (tested in Notepad++):

    Enter this regex in the Find what field:

    ((?:^|\r\n)[^"]*+"[^\r\n"]*+)\r\n([^"]*+")

    Enter this string in the Replace with field:

    $1 $2

    Make sure the Wrap around check box (and Regular expression radio button) are selected.

    Do a Replace All as many times as required (until the “0 occurrences were replaced” dialog pops up).

    Explanation:

    (
      (?:^|\r\n)     Begin at start of file or before the CRLF before the start of a record
      [^"]*+         Consume all chars up to the opening "
      "              Consume the opening "
      [^\r\n"]*+     Consume all chars up to either the first CRLF or the closing "
    )                Save as capturing group 1 (= everything in record before the target CRLF)
    \r\n             Consume the target CRLF without capturing it
    (
      [^"]*+         Consume all chars up to the closing "
      "              Consume the closing "
    )                Save as capturing group 2 (= the rest of the string after the target CRLF)
    

    Note: The *+ is a possessive quantifier. Use them appropriately to speed up execution.

    Update:

    This more general version of the regex will work with any line break sequence (\r\n, \r or \n):

    ((?:^|[\r\n]+)[^"]*+"[^\r\n"]*+)[\r\n]+([^"]*+")

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I need to clean up various Word 'smart' characters in user input, including but
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.