+ Reply to Thread
Results 1 to 5 of 5

How to replace Carriage Return(CRLF) to Line Feed(LF) in text file from excel

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    How to replace Carriage Return(CRLF) to Line Feed(LF) in text file from excel

    Hi,
    I exported one sheet in my workbook as text file(Tab deliminated).
    When I opened the text file in Note pad++, I saw CRLF, every row.
    I'd like to replace this 'CRLF' to 'LF'.
    How can I do that?


    Dim NewWb As Workbook
    Dim fname As Variant

    fname = "C:\\"
    NewWb.SaveAs fname _
    , FileFormat:=xlText, CreateBackup:=False
    New.Close False

    Before closing NewWb, can I open the txt.file and replace it?

    Thanks in advance.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: How to replace Carriage Return(CRLF) to Line Feed(LF) in text file from excel

    Maybe something like this. In the Replace() line, use vbCRLF and vbLF. Change other parts such as the path and filename to suit.
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: How to replace Carriage Return(CRLF) to Line Feed(LF) in text file from excel

    Simply
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: How to replace Carriage Return(CRLF) to Line Feed(LF) in text file from excel

    Maybe this too?

    Change output path to suit..

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: How to replace Carriage Return(CRLF) to Line Feed(LF) in text file from excel

    Thank you so much all!!

+ 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. While saving as CSV, need a carriage return/line feed
    By Ash Gajjar in forum Excel General
    Replies: 0
    Last Post: 11-06-2013, 12:17 PM
  2. Forcing a line feed within a cell (Carriage Return)
    By Marcus Gee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-18-2013, 11:24 AM
  3. Carriage Return Line Feed
    By wlcummings in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2011, 05:03 PM
  4. Split or Replace Carrige Return Line Feed chars
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2010, 08:22 PM
  5. Replies: 8
    Last Post: 11-07-2008, 09:26 AM
  6. Parsing Excel Column based on Line Feed/Carriage Return?
    By kj2398 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2007, 01:23 PM
  7. [SOLVED] How do I remove multiple line feed(s) or carriage return(s)?
    By sra in forum Excel General
    Replies: 1
    Last Post: 05-24-2005, 07:06 PM
  8. [SOLVED] Find/Replace carriage return & line feed characters in Excel.
    By Mary Cullen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-04-2005, 04:06 PM

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