Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Abu Dhabi

    Unanswered: Edit the Value in the text file from VB 6.0.

    Hi All,

    Facing problem in editing the value in the text file from VB 6.0.
    Actually,I want i modify the value in the text file by using vb 6.0.
    How can i delete the line or specific char from the text file.
    I can read or insert value into the text file but how can i delete or edit the line in the text file. i have tried using WRITE or WRITELINE command
    but its not doing what i want.

    Below is my code can any one find where am i doing mistake

    vDate = DT.Value
    vSTR = "c:\AMO\FILEGENERATE\sedbvf.text"
    Open vSTR For Input As #1
    vCOUNT = 0
    vCOUNT = vCOUNT + 1
    Line Input #1, A
    If InStr(1, A, "200") > 0 Then
    vPOSITION = InStr(1, A, "200")
    vSTR = Mid(A, 1, vPOSITION - 1)
    A = vSTR
    write (A)
    End If
    Loop Until EOF(1)

    Close #1

    Thank for your effords

  2. #2
    Join Date
    Mar 2004


    Use a Temp file to contain the new data. After that, kill the old file and rename the temp file to the name of the old file.
    Sequential files have their limitations

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts