+ Reply to Thread
Results 1 to 4 of 4

How to remove a CR and LF form txt file

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    Pretoria
    MS-Off Ver
    Excel 2010
    Posts
    2

    How to remove a CR and LF form txt file

    I have a .txt file with 147693 lines that I need to open in MS Excel.
    I need to remove 6 pairs of CR and LF at the end of the first 6 lines,
    then skip one (which is a legitimate CR, LF)
    then continue to the following 6 pairs.

    Any help ho to do that?
    I understand I will have to write a macro to do this, but have no idea hoe to find and remove / go to next CR to remove.

    I tried this in Notepad ++
    It runs fine if I do 50 at a time when running a macro, but Notepad ++ gets confused if I try to do more than 500 at a time.
    Ideally I would like to do it in Excel in one go.

    I can provide the original file; truncated after say 1000 records and then the matching Microsoft Excel file that was successfully converted..If needed.

    Any advice will be appreciated very much

    Frits

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,052

    Re: How to remove a CR and LF form txt file

    Hi there... and welcome to the Excel Forum.

    Please attach a sample workbook. Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    The paperclip icon
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    08-15-2012
    Location
    Pretoria
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to remove a CR and LF form txt file

    Quote Originally Posted by Glenn Kennedy View Post
    Hi there... and welcome to the Excel Forum.

    Please attach a sample workbook. Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    The paperclip icon

    Hi Glenn,

    Thanks for the reply:

    Attached is the PDF I export and the Excel file I would like to generate from that.
    Currently I take it through a series of steps including Notepad ++.

    Kind Regards

    Frits

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,052

    Re: How to remove a CR and LF form txt file

    If you can get access to Adobe Acrobat Pro, this is so simple. All you have to do is to "Save as other" and choose Excel as the output format. The date/time string is converted easily to a real date time using this formula:
    Date: =LEFT(SUBSTITUTE(B2,CHAR(10),""),10)+0
    Time: =RIGHT(SUBSTITUTE(B2,CHAR(10),""),8)+0

    You can also do this with Adobe Reader, but an annual fee is payable.

    If that won't do - can you attach the text file that you're working with?
    Attached Files Attached Files

+ 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. [SOLVED] Saving MASTER file, automatically remove part of file name and append current date?
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2014, 08:13 AM
  2. [SOLVED] Want to remove $ sign Form A4:A50
    By HaroonSid in forum Excel General
    Replies: 7
    Last Post: 04-21-2014, 12:52 AM
  3. [SOLVED] Remove days at end of form
    By brians34 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2014, 05:12 PM
  4. [SOLVED] Excel Form Field? whatever it is, I can't remove it!
    By NMullis in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-26-2012, 09:06 AM
  5. remove shadows from form buttons?
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2011, 04:21 PM
  6. Add a remove button to form
    By Khaos176 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-19-2008, 12:33 PM
  7. how do i remove focus from form?
    By exceltools2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2008, 03:21 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