+ Reply to Thread
Results 1 to 2 of 2

Simple Line Add-on function

  1. #1
    Registered User
    Join Date
    04-11-2007
    Posts
    1

    Question Simple Line Add-on function

    Hi

    I need a macro that reads a .Txt file and add ":::" at the end of each line.

    Txt file looks like :

    [email protected]:maxou

    and need to have

    [email protected]:maxou:::

    For each of the line in the txt file.

    Thank you

    J

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Jeffos101,

    This macro reads a single line from the text file, adds the colons, and writes the new data to a temp file on drive "C". If you don't have a drive "C" then you will need to change it in the TmpFile statement of the macro. Once all changes have been made, the original file is destroyed and the temp file is renamed as the original file and will be located in the same directory and drive as the original. This could also be written using the File Scripting Object (FSO), but I find this code easier to read and understand.

    Please Login or Register  to view this content.
    To run the macro insert a Standrard VBA Module into your workbook and copy this code into it.

    Calling the Macro:
    ModifyTextFile "C:\My Documents\Internet Links\Links.txt"
    (Include the Path with the File Name)

    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 04-11-2007 at 07:27 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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