+ Reply to Thread
Results 1 to 3 of 3

How to merge lines in a text file

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Tempe, Arizona, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    How to merge lines in a text file

    Hello,
    I am dealing with an industrial tool script that I need to translate into a value matrix.
    You will find below a sanitized sample.

    At each step, input commands are separated by a comma. and a final semicolon indicates the end of the step.
    My problem is that the commands are spread over several lines. See below.
    After opening the file, I want to merge all the commands into a single line, prior to transfer to a worksheet.

    I imagine that I need to make a test on the last character.
    If last character "," then deleted carriage return and repeat test

    Is there an Excel VBA code to do that ?


    Thanks for the help !


    45 "H, Initial setting",
    N.line close, N.run close, H.line open, H.run open,

    X.source = 100, y.source = 10, y.push = 100,
    RunHydrid = 100, RunMODopant = 500, RunMO to 2000,
    a = 500, b = 2000, www off;

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to merge lines in a text file

    Tempe_VBA,

    Welcome to the forum!
    Here's one way...
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Tempe, Arizona, USA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Smile Re: How to merge lines in a text file

    It worked.
    Thanks a lot.
    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)

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