Results 1 to 21 of 21

fso.OpenTextFile / ts.Readline - Dealing with embedded Line Feeds

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    281

    fso.OpenTextFile / ts.Readline - Dealing with embedded Line Feeds

    I am reading text files line by line using the fso.OpenTextFile / Textstream.Readline method to get row counts, make some line amendments and then write the lines back out to a new file.

    The issue I have is that I often get text files with embedded linefeeds in some rows which is causing .Readline to end at that point and then start reading the rest of the line as a new line.

    Is there any change or addition can add to this method so it will ignore any embedded linefeeds and correctly read until the end of the line?

    The other method I was experimenting with was ADODB.stream, and with that .ReadText(adReadLine) works fine and seems to ignore the embedded linefeeds, but I've found ADODB to be slower the larger the files get.

    Unable to upload a workbook at the moment, but hopefully that shouldn't matter in this case.
    Last edited by EchoPassenger; 06-23-2023 at 06:37 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Code Logic for Allowing & Ignoring Line Feeds
    By maxeffort33 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-13-2021, 08:30 AM
  2. Code Logic for Allowing & Ignoring Line Feeds
    By maxeffort33 in forum Excel General
    Replies: 0
    Last Post: 04-12-2021, 10:23 PM
  3. Replies: 3
    Last Post: 10-22-2019, 09:00 AM
  4. Multiple line invoice that feeds a database on a seperate sheet
    By vicken25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2014, 07:32 AM
  5. Parsing of line feeds in text file
    By pedron in forum Excel General
    Replies: 1
    Last Post: 02-01-2012, 06:21 PM
  6. Replies: 0
    Last Post: 12-09-2008, 08:42 PM
  7. MS Query and Carriage Returns/Line Feeds
    By Gary Brown in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2005, 10:24 AM

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