Windows Vista Forums

Howto: Add lines of text from a specific point in a text file..
  1. #1


    Daz Guest

    Howto: Add lines of text from a specific point in a text file..

    Hi all,

    I wonder if you can help me... I have been doing allot of manual
    updates to ini files that i am using and would like to make things a
    little easier on myself by trying to automate as much as i can. What
    i need at the moment is a way of adding some addition text to a file
    that already exists - the catch is that i need to add it to the end of
    a group of information and that information starts around the middle
    of the file. E.g. below.


    E.g. --- SVCPack.inf ---
    [CatalogHeader]

    [Version]
    BuildNumber=2600
    MinorVersion=1
    MajorVersion=5
    Signature="$WINDOWS NT$"



    [SetupData]
    CatalogSubDir="\I386\svcpack"

    [SetupHotfixesToRun]
    KB892130.exe /q /n /z
    wmp11.exe /q /n /z /o
    wmfdist11.exe /q /n /z /o
    mscomppackv1.exe /q /n /z /o
    wudf01000.exe /q /n /z /o

    [ProductCatalogsToInstall]
    KB892130.cat
    wmp11.cat
    WMFDist11.cat
    MSCompPackV1.cat
    Wudf01000.cat
    --- End file ---

    So i would like to be able to add additional commands (lines of text)
    to the [SetupHotfixesToRun] section of the file by running a single
    vbscript. The text/instructions i would like to be able to have
    listed in the vbs (or a comma delimited file that can be called from
    the vbs)

    I would appreciate any suggestions, code snippets etc that can point
    me in the write direction.

    Cheers,
    Darren

      My System SpecsSystem Spec

  2. #2


    McKirahan Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    "Daz" <darren.blackley@xxxxxx> wrote in message
    news:d37aebf2-7853-417c-ab95-5fd7f390dd5a@xxxxxx

    > Hi all,
    >
    > I wonder if you can help me... I have been doing allot of manual
    > updates to ini files that i am using and would like to make things a
    > little easier on myself by trying to automate as much as i can. What
    > i need at the moment is a way of adding some addition text to a file
    > that already exists - the catch is that i need to add it to the end of
    > a group of information and that information starts around the middle
    > of the file. E.g. below.
    >
    [snip]

    >
    > So i would like to be able to add additional commands (lines of text)
    > to the [SetupHotfixesToRun] section of the file by running a single
    > vbscript. The text/instructions i would like to be able to have
    > listed in the vbs (or a comma delimited file that can be called from
    > the vbs)
    Are the additional lines in a text file?
    Are you working with multiple files?
    Is the INF file hundreds of lines long or are there dozens of [sections]?
    If not, what's wrong with using Notepad to paste in your new lines?
    How often is this done? What will be the savings if it's automated?



      My System SpecsSystem Spec

  3. #3


    Daz Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    > Are the additional lines in a text file?

    The example above is a classic example and could have different
    entries and more or less entries in each section. As for additional
    lines, yes it would as the script solution i am looking for would add
    these additonal lines - so in the above example, the script would add
    the additional entries after "wudf01000.exe /q /n /z /o"

    > Are you working with multiple files?
    Multiple files as in more than one to add - yes.

    > Is the INF file hundreds of lines long or are there dozens of [sections]?
    The above example is similar to what i would be using. There will be
    no more sections than shown above, however the contents of each
    section can grow in number.

    > If not, what's wrong with using Notepad to paste in your new lines?
    Because i am managing a number of installation that use different
    configuration, however they all use the same ini file name. So as i
    said originally i am trying to make things a little more manageable.

    > How often is this done? *What will be the savings if it's automated?
    It will be done as often as needed - can be as often as weekly as a
    number of utilities etc are often updated.

    Hope this answers all your questions.


      My System SpecsSystem Spec

  4. #4


    Reventlov Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    Il giorno Mon, 23 Jun 2008 01:55:59 -0700 (PDT), Daz <darren.blackley@xxxxxx> ha
    scritto:

    >Hi all,
    >
    >I wonder if you can help me... I have been doing allot of manual
    >updates to ini files that i am using and would like to make things a
    >little easier on myself by trying to automate as much as i can. What
    >i need at the moment is a way of adding some addition text to a file
    >that already exists - the catch is that i need to add it to the end of
    >a group of information and that information starts around the middle
    >of the file. E.g. below.
    This renames the file to .bak, reads it and writes it with the original name. When it
    reads Yoursection writes additional data.


    percorso="C:\mydir\myfile.txt"

    Const ForReading = 1 'Open a file for reading only. You can't write to this file
    Const ForWriting = 2 'Open a file for writing
    q= chr(34) 'virgolette
    Set fso = CreateObject("Scripting.FileSystemObject")
    on error resume next
    fso.DeleteFile percorso & ".BAK"
    on error goto 0
    fso.MoveFile percorso ,percorso & ".BAK"
    set source = fso.OpenTextFile(percorso & .BAK",ForReading)
    set dest= fso.OpenTextFile(percorso ,ForWriting,TRUE)
    Do While source.AtEndOfStream <> True
    riga = source.ReadLine
    if instr(1,riga,"[yoursection]")>0 then
    dest.writeline "[yoursection]" & vbcrlf & "................"
    else
    dest.writeline riga
    end if
    Loop
    source.Close
    dest.close

    End Sub


    --
    Giovanni Cenati (Bergamo, Italy)
    Write to "Reventlov" at katamail com
    http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
    --

      My System SpecsSystem Spec

  5. #5


    Daz Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    > What I meant was: where do lines to be added exist?

    "The text/instructions i would like to be able to have
    listed in the vbs (or a comma delimited file that can be called from
    the vbs)"

    >
    > "they all use the same ini file name" -- sre the files in differnet folders
    > and/or on different systems?
    >
    > Sorry, I'm still trying to gather your requirements.
    >
    > It's just not very clear (to me) how you envision an automated
    > effort to work.
    >
    > Do you have a list of filenames with their paths from which to select?
    > Where are the additional lines -- in a text file or known when needed.
    Sorry about that - i will try to give you further examples.

    I would like to add something like;

    7z457.exe /S
    AC3.exe /S
    AutoIt32100.exe /S
    JRE6.exe /quiet /norestart
    Sysinternals.exe
    Wget.exe
    INSTALL_FLASH_PLAYER.EXE /silent
    WindowsXP-KB923789-x86-ENU.exe /Q:A /R:N
    DX.exe

    these entries would be appended to the [SetupHotfixesToRun] section
    like e.g. below

    [SetupHotfixesToRun]
    KB892130.exe /q /n /z
    wmp11.exe /q /n /z /o
    wmfdist11.exe /q /n /z /o
    mscomppackv1.exe /q /n /z /o
    wudf01000.exe /q /n /z /o
    ; Added below
    7z457.exe /S
    AC3.exe /S
    AutoIt32100.exe /S
    JRE6.exe /quiet /norestart
    Sysinternals.exe
    Wget.exe
    INSTALL_FLASH_PLAYER.EXE /silent
    WindowsXP-KB923789-x86-ENU.exe /Q:A /R:N
    DX.exe

    >
    > I developed an HTA (= VBS + a UI) that allows entry of a filename
    > (which must exist in the HTA's folder); the contents of the file are
    > displayed in a <textarea> and may be changed and saved.
    >
    > An enhancement would be to have a list of path+filenames;
    > the selection of one would cause it to be displayed in a <textarea>
    > and a list of the [sections] within it could be displayed as a
    > dropdown selection list. Another <textarea> would allow for
    > entry of the "additional lines". *You would then select a
    > [section] from the list and click a button called "append" to
    > append the "additional lines" to the end of the selected [section].
    > Alternatively, you could manually insert additional lines
    > where ever you wanted. *You would then click a "save" button.
    >
    > Your thoughts?
    Sound great! - then i could select the file i want (would need to be
    able to add a command-line argument to the entry) and then after
    creating an array add this to the [SetupHotfixesToRun].


      My System SpecsSystem Spec

  6. #6


    McKirahan Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    > "Daz" <darren.blackley@xxxxxx> wrote in message
    news:2e7038f4-119c-49a9-885f-> bfa16d8e12f2@xxxxxx...

    > > What I meant was: where do lines to be added exist?
    >
    > "The text/instructions i would like to be able to have
    > listed in the vbs (or a comma delimited file that can be called from
    > the vbs)"
    >

    > >
    > > "they all use the same ini file name" -- sre the files in differnet
    folders

    > > and/or on different systems?
    > >
    > > Sorry, I'm still trying to gather your requirements.
    > >
    > > It's just not very clear (to me) how you envision an automated
    > > effort to work.
    > >
    > > Do you have a list of filenames with their paths from which to select?
    > > Where are the additional lines -- in a text file or known when needed.
    >
    > Sorry about that - i will try to give you further examples.
    [snip]

    > > I developed an HTA (= VBS + a UI) that allows entry of a filename
    > > (which must exist in the HTA's folder); the contents of the file are
    > > displayed in a <textarea> and may be changed and saved.
    > >
    > > An enhancement would be to have a list of path+filenames;
    > > the selection of one would cause it to be displayed in a <textarea>
    > > and a list of the [sections] within it could be displayed as a
    > > dropdown selection list. Another <textarea> would allow for
    > > entry of the "additional lines". You would then select a
    > > [section] from the list and click a button called "append" to
    > > append the "additional lines" to the end of the selected [section].
    > > Alternatively, you could manually insert additional lines
    > > where ever you wanted. You would then click a "save" button.
    > >
    > > Your thoughts?
    >
    > Sound great! - then i could select the file i want (would need to be
    > able to add a command-line argument to the entry) and then after
    > creating an array add this to the [SetupHotfixesToRun].
    What does this mean?
    "would need to be able to add a command-line argument to the entry"

    Why/how would a "comma delimited file" be used for the additional lines?

    Do you have a list of filenames with their paths from which to select?
    I don't need them, I just want to know if you have them in a list?



      My System SpecsSystem Spec

  7. #7


    McKirahan Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    "McKirahan" <News@xxxxxx> wrote in message
    news:scidnd3zCclfOcLVnZ2dnUVZ_rfinZ2d@xxxxxx

    > > "Daz" <darren.blackley@xxxxxx> wrote in message
    > news:2e7038f4-119c-49a9-885f->
    bfa16d8e12f2@xxxxxx...

    [snip]

    I don't have answers to all of my questions but here's something.


    Will this help? Watch for word-wrap.

    Save it as "SVCPack.hta" then create "SVCPack.txt" which contains a list
    of files (with their full path; one per line) that you may want to edit.
    For example, "C:\Temp\SVCPack.inf".

    To run it, doubleclick on "SVCPack.hta" (in Windows Explorer),
    select a file by clicking on its name and its contents will be displayed
    in the text area. You can now manually edit the file or enter one or more
    lines of text which you can insert at the cursor location. After making
    your changes click "Replace" to backup the file then replace it.


    <html>
    <head>
    <title>SVCPack.hta</title>
    <HTA:Application
    ID = "HTA"
    ApplicationName = "SVCPack"
    Border = "thin"
    BorderStyle = "normal"
    Caption = "yes"
    ContextMenu="yes"
    Icon = ""
    InnerBorder="no"
    MaximizeButton = "yes"
    MinimizeButton = "yes"
    Navigable="yes"
    Scroll="yes"
    SrollFlat="no"
    Selection="yes"
    ShowInTaskBar = "yes"
    SingleInstance = "yes"
    SysMenu = "yes"
    Version = "1.0"
    WindowState = "maximize"

    >
    <script type="text/vbscript">
    Option Explicit
    '****
    '* This HTA (HTML Application) does the following:
    '* 1) Reads "cTXT" which contains a list of (path+) filenames
    '* and builds a dropdown list to allow selection.
    '* 2) Reads the selected file into a textarea;
    '* (".inf" extensions builds a dropdown list of Sections).
    '* 3) Changes may be made directly to the file or lines
    '* may entered in a textarea for inserting into multiple files.
    '* 4) If the file has been changed then it may be saved which
    '* replaces the original file after it is "backed up" first by
    '* copying it with a timestamp extension: ".yyyymmddhhnnss".
    '****
    '*
    '* Declare Constants
    '*
    Const cHTA = "SVCPack.hta"
    Const cTXT = "SVCPack.txt"
    '*
    '* Declare Globals
    '*
    Dim sDIR
    sDIR = CreateObject("WScript.Shell").CurrentDirectory + "\"
    Dim sERR
    Dim oFSO
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Dim sINF
    Dim dNOW
    Dim sNOW ' yyyymmddhhnnss
    Dim aOTF
    Dim iOTF
    Dim oOTF
    Dim sOTF
    Dim iOPT
    Dim sOPT
    Dim sSAV
    Dim sTMP

    Sub File_List()
    '****
    '* Read file.
    '****
    '*
    '* Test
    '*
    If Not oFSO.FileExists(sDIR & cTXT) Then
    sERR = "<b>" & cTXT & "</b> does not exist!"
    document.getElementById("Note").innerHTML = sERR
    Exit Sub
    End If
    '*
    '* Read
    '*
    Set oOTF = oFSO.OpenTextFile(sDIR & cTXT,1)
    sOTF = oOTF.ReadAll
    Set oOTF = Nothing
    '*
    '* List
    '*
    iOPT = 1
    sOPT = "<option value=''>" & vbCrLf
    aOTF = Split(sOTF,vbCrLf)
    For iOTF = 0 To UBound(aOTF)
    sOTF = Trim(aOTF(iOTF))
    If LCase(Left(sOTF,1)) >= "a" _
    And LCase(Left(sOTF,1)) <= "z" _
    And Mid(sOTF,2,2) = ":\" Then
    If oFSO.FileExists(sOTF) Then
    iOPT = iOPT + 1
    sOPT = sOPT & "<option value='" & sOTF & "'>" & sOTF &
    vbCrLf
    Else
    Alert(sOTF & " file does not exist!")
    End If
    End If
    Next
    sOPT = sOPT & "</select>" & vbCrLf
    sOPT = "<select id='Pick1' onchange='File_Read()' size='" & iOPT & "'>"
    & sOPT & vbCrLf
    '*
    document.getElementById("List").innerHTML = sOPT
    End Sub

    Sub File_Read()
    '****
    '* Read file.
    '****
    document.getElementById("Note").innerHTML = ""
    document.getElementById("Sect").innerHTML = ""
    document.getElementById("Data").Value = ""
    sINF = document.getElementById("Pick1").Value
    If sINF = "" Then Exit Sub
    '*
    '* Test
    '*
    If Not oFSO.FileExists(sINF) Then
    sERR = "<b>" & sINF & "</b> does not exist!"
    document.getElementById("Note").innerHTML = sERR
    Exit Sub
    End If
    '*
    '* Read
    '*
    Set oOTF = oFSO.OpenTextFile(sINF,1)
    sOTF = oOTF.ReadAll
    Set oOTF = Nothing
    document.getElementById("Data").Value = sOTF
    sSAV = sOTF
    '*
    '* INF Sections
    '*
    If Right(LCase(sINF),4) <> ".inf" Then Exit Sub
    iOPT = 0
    sOPT = ""
    aOTF = Split(sOTF,vbCrLf)
    For iOTF = 0 To UBound(aOTF)
    sOTF = Trim(aOTF(iOTF))
    If Left(sOTF,1) = "[" _
    And Right(sOTF,1) = "]" Then
    iOPT = iOPT + 1
    sOPT = sOPT & "<option value='" & sOTF & "'>" & sOTF & vbCrLf
    End If
    Next
    '*
    sOPT = sOPT & "</select>" & vbCrLf
    sOPT = "<select size='" & iOPT & "'>" & sOPT & vbCrLf
    sOPT = "<b>Sections:</b><br>" & vbCrLf & sOPT & vbCrLf
    document.getElementById("Sect").innerHTML = sOPT
    End Sub

    Sub File_Position()
    '****
    '* Inserting at the cursor using JavaScript
    '*
    http://alexking.org/blog/2003/06/02/...ing-javascript
    /
    '****
    sTMP = document.getElementById("Entry").Value
    If sTMP = "" Then Exit Sub
    If MsgBox("Insert text at cursor position?",vbQuestion+vbYesNo,cHTA) =
    vbYes Then
    document.getElementById("Data").focus()
    document.selection.createRange().text = sTMP
    End If
    End Sub

    Sub File_Replace()
    '****
    '* Copy old file and Write new file.
    '****
    dNOW = Now
    sNOW = Year(dNOW) _
    & (10^8 * Month(dNOW)) _
    + (10^6 * Day(dNOW)) _
    + (10^4 * Hour(dNOW)) _
    + (10^2 * Minute(dNOW)) _
    + (10^0 * Second(dNOW))
    sOTF = document.getElementById("Data").Value
    '*
    '* Test
    '*
    If sINF = "" Then
    sERR = "<b>No file selected!</b>"
    document.getElementById("Note").innerHTML = sERR
    Exit Sub
    ElseIf sOTF = "" Then
    sERR = "<b>" & sINF & "</b> is empty!"
    document.getElementById("Note").innerHTML = sERR
    Exit Sub
    ElseIf sSAV = sOTF Then
    sERR = "<b>" & sINF & "</b> not changed!"
    document.getElementById("Note").innerHTML = sERR
    Exit Sub
    End If
    '*
    '* Copy
    '*
    oFSO.CopyFile sINF, sINF & "." & sNOW
    '*
    '* Write
    '*
    Set oOTF = oFSO.OpenTextFile(sINF,2,true)
    oOTF.Write(sOTF)
    Set oOTF = Nothing
    End Sub

    Sub Window_Onload()
    '****
    '* List files.
    '****
    Call File_List()
    End Sub
    </script>
    <style type="text/css">
    body,td,th { font-family:Arial; font-size:80% }
    ..butt { background-color:white; width:80px; height:22px }
    ..text { font-family:Courier; font-size:10pt }
    ..yell { background-color:yellow }
    </style>
    </head>
    <body>
    <table border="0" width="90%">
    <tr valign="top">
    <td>
    <b>Select a file:</b>
    <br>
    <span id="List"></span>
    <br><br>
    <span class="yell" id="Note"></span>
    <br><br>
    <b>Text to be inserted at cursor position:</b>
    <br>
    <textarea class="text" id="Entry" cols="30" rows="10"
    wrap="virtual"></textarea>
    <br><br>
    <input type="button" class="butt" value="Insert"
    onclick="File_Position()">
    &nbsp;
    <input type="button" class="butt" value="Replace"
    onclick="File_Replace()">
    &nbsp;
    <input type="button" class="butt" value="Exit" onClick="Self.Close()">
    <br><br>
    <span id="Sect"></span>
    </td>
    <td>
    <textarea class="text" id="Data" cols="72" rows="50"
    wrap="virtual"></textarea>
    </td>
    </tr>
    </table>
    </body>
    </html>




      My System SpecsSystem Spec

  8. #8


    Daz Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    On Jun 23, 9:26*pm, "McKirahan" <N...@xxxxxx> wrote:

    > > "Daz" <darren.black...@xxxxxx> wrote in message
    >
    > news:2e7038f4-119c-49a9-885f-> bfa16d8e1...@xxxxxx
    >
    >
    >

    > > > What I meant was: where do lines to be added exist?
    >

    > > "The text/instructions i would like to be able to have
    > > listed in the vbs (or a comma delimited file that can be called from
    > > the vbs)"
    >

    > > > "they all use the same ini file name" -- sre the files in differnet
    > folders

    > > > and/or on different systems?
    >

    > > > Sorry, I'm still trying to gather your requirements.
    >

    > > > It's just not very clear (to me) how you envision an automated
    > > > effort to work.
    >

    > > > Do you have a list of filenames with their paths from which to select?
    > > > Where are the additional lines -- in a text file or known when needed.
    >

    > > Sorry about that - i will try to give you further examples.
    >
    > [snip]
    >
    >
    >

    > > > I developed an HTA (= VBS + a UI) that allows entry of a filename
    > > > (which must exist in the HTA's folder); the contents of the file are
    > > > displayed in a <textarea> and may be changed and saved.
    >

    > > > An enhancement would be to have a list of path+filenames;
    > > > the selection of one would cause it to be displayed in a <textarea>
    > > > and a list of the [sections] within it could be displayed as a
    > > > dropdown selection list. Another <textarea> would allow for
    > > > entry of the "additional lines". You would then select a
    > > > [section] from the list and click a button called "append" to
    > > > append the "additional lines" to the end of the selected [section].
    > > > Alternatively, you could manually insert additional lines
    > > > where ever you wanted. You would then click a "save" button.
    >

    > > > Your thoughts?
    >

    > > Sound great! - then i could select the file i want (would need to be
    > > able to add a command-line argument to the entry) and then after
    > > creating an array add this to the [SetupHotfixesToRun].
    >
    > What does this mean?
    > "would need to be able to add a command-line argument to the entry"
    I thought the config.file world/could be stated as a command-line
    argument.

    >
    > Why/how would a "comma delimited file" be used for the additional lines?
    Sorry that is the only way i am aware with in this type of instance.

    >
    > Do you have a list of filenames with their paths from which to select?
    > I don't need them, I just want to know if you have them in a list?
    Yes i have a list.

      My System SpecsSystem Spec

  9. #9


    Daz Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    On Jun 24, 5:56*am, "McKirahan" <N...@xxxxxx> wrote:

    > "McKirahan" <N...@xxxxxx> wrote in message
    >
    > news:scidnd3zCclfOcLVnZ2dnUVZ_rfinZ2d@xxxxxx> > "Daz" <darren.black...@xxxxxx> wrote in message

    > > news:2e7038f4-119c-49a9-885f->
    >
    > bfa16d8e1...@xxxxxx
    >
    > [snip]
    >
    > I don't have answers to all of my questions but here's something.
    >
    > Will this help? *Watch for word-wrap.
    >
    > Save it as "SVCPack.hta" then create "SVCPack.txt" which contains a list
    > of files (with their full path; one per line) that you may want to edit.
    > For example, "C:\Temp\SVCPack.inf".
    >
    > To run it, doubleclick on "SVCPack.hta" (in Windows Explorer),
    > select a file by clicking on its name and its contents will be displayed
    > in the text area. *You can now manually edit the file or enter one or more
    > lines of text which you can insert at the cursor location. *After making
    > your changes click "Replace" to backup the file then replace it.
    >

    > '* *Inserting at the cursor using JavaScript
    > '*http://alexking.org/blog/2003/06/02/...rsor-using-jav....
    > /
    Do i need to add this script in here?

    I have created the HTA and the TXT file and when i load the hta i get
    " & sOTF & "'>" & sOTF & vbCrLf End If Next '* sOPT = sOPT & " in the
    first drop-down menu....

      My System SpecsSystem Spec

  10. #10


    McKirahan Guest

    Re: Howto: Add lines of text from a specific point in a text file..

    > "Daz" <darren.blackley@xxxxxx> wrote in message
    news:4f1e0127-4f65-43ad-8dcd-> b763f9d8aceb@xxxxxx...

    > On Jun 24, 5:56 am, "McKirahan" <N...@xxxxxx> wrote:

    > > "McKirahan" <N...@xxxxxx> wrote in message
    > >
    > > news:scidnd3zCclfOcLVnZ2dnUVZ_rfinZ2d@xxxxxx> > "Daz"
    <darren.black...@xxxxxx> wrote in > message

    > > > news:2e7038f4-119c-49a9-885f->
    > >
    > > bfa16d8e1...@xxxxxx
    > >
    > > [snip]
    > >
    > > I don't have answers to all of my questions but here's something.
    > >
    > > Will this help? Watch for word-wrap.
    > >
    > > Save it as "SVCPack.hta" then create "SVCPack.txt" which contains a list
    > > of files (with their full path; one per line) that you may want to edit.
    > > For example, "C:\Temp\SVCPack.inf".
    > >
    > > To run it, doubleclick on "SVCPack.hta" (in Windows Explorer),
    > > select a file by clicking on its name and its contents will be displayed
    > > in the text area. You can now manually edit the file or enter one or
    more

    > > lines of text which you can insert at the cursor location. After making
    > > your changes click "Replace" to backup the file then replace it.
    > >
    >

    > > '* Inserting at the cursor using JavaScript
    > >
    '*http://alexking.org/blog/2003/06/02/...rsor-using-jav...

    > > /
    >
    > Do i need to add this script in here?
    No, that's just a comment about where I got that technique from.
    The URL wrapped -- the lone "/" neloings at the end of the URL.

    > I have created the HTA and the TXT file and when i load the hta i get
    > " & sOTF & "'>" & sOTF & vbCrLf End If Next '* sOPT = sOPT & " in the
    > first drop-down menu....
    It looks like a word-wrap problem. That is supposed to be on 3 lines:

    sOPT = sOPT & "<option value='" & sOTF & "'>" & sOTF & vbCrLf
    End If
    Next

    Hopefully, your newreader kept the indentations that I had in the code.






      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
Howto: Add lines of text from a specific point in a text file.. problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
read text file - but starting at a specific point (not the very first character of the very first line) Cary Shultz VB Script 1 14 Jul 2009
Using lines in a text file tERRY PowerShell 3 01 Aug 2008
Removing lines from a text file Did PowerShell 3 15 Mar 2007
HowTo: Get Text from a file and put in a string. Brandon Shell PowerShell 4 22 Dec 2006
removing first three lines in a text file fixitchris PowerShell 2 17 Nov 2006