+ Reply to Thread
Results 1 to 8 of 8

Removing multiple line breaks into single line break

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Removing multiple line breaks into single line break

    Hi,
    I have attached and Excel file. In comments column can those giant spaces between paragraphs be made to just one space? Snapshot is attached.

    Thanks and Regards,

    Line Breaks Snapshot.png
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,458

    Re: Removing multiple line breaks into single line break

    Try in next cell, C2:

    Please Login or Register  to view this content.
    Drag down

    Copy/past special/ value: back to B2, or other cell D2
    Attached Files Attached Files
    Quang PT

  3. #3
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Removing multiple line breaks into single line break

    See updated post.
    Last edited by hrlngrv; 12-02-2020 at 01:59 AM. Reason: replaced

  4. #4
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Removing multiple line breaks into single line break

    There might be vertical bars in the text. Actually, using [Ctrl]+F and using Find All, B178, B200 and B212 each contain vertical bars. Safer to use non-glyph characters, e.g., CHAR(8) or CHAR(127).

    Next, there are no CHAR(13) not followed by CHAR(10) in B2:B244.

    Standard approach when there's something like TRIM,

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    That assumes there should be no empty text lines between paragraphs. If there should be an empty line between paragraphs,

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    To be honest, this is something Google Sheets handles so much better than Excel that it may be worthwhile to perform this edit in Google Sheets. Here's a link to a copy of the OP's file in Google Drive. The cells in B2:B244 are modified as needed in D2:D244. The formula I used is a far more compact

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Removing multiple line breaks into single line break

    I appreciate your effort and it works but the multiple line breaks should be substituted with Two Line Breaks so that we could see the space atleast. In your solution it has completely removed the space. I hope you understand my concern.

    Thanks and regards.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Removing multiple line breaks into single line break

    Please try at C2

    =SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B2," ","Ω"),CHAR(13)," "),CHAR(10)," "))," ",REPT(CHAR(10),2)),"Ω"," ")
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Removing multiple line breaks into single line break

    Did you try my 2nd formula?
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Removing multiple line breaks into single line break

    Thank you so much everybody for helping me out. I am satisfied completely

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 10-21-2020, 11:42 PM
  2. Formulas and Line Breaks - inserting mid-string & removing excess breaks
    By MattDay2u in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-24-2017, 09:54 AM
  3. Replies: 7
    Last Post: 08-06-2014, 08:47 AM
  4. Replies: 8
    Last Post: 07-14-2014, 03:07 AM
  5. Replies: 0
    Last Post: 02-19-2014, 03:49 PM
  6. Removing Existing Page Breaks and Inserting a Page Break every third Total Line
    By Kalvas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2013, 05:12 AM
  7. Removing Line Breaks In A Cell
    By Ross220681 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-10-2009, 11:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1