change the specific line


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: change the specific line

  1. #1
    Join Date
    Feb 2006
    Location
    malaysia
    Posts
    25

    Unhappy change the specific line

    hi by using VB how to read the specific line and change the line in the tex file.
    i has 92 line and i only want to change the line 64
    here the line
    Rep.SetProperty "Dates","1/8/2006-1/10/2006"

    i just want to capture the daily date into txt file

    plz help me it is urgent

  2. #2
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    If the lines are of equal length you can open a file for Random with LEN=nnn, and then specifically reference any record.

    However, if they are not the same length, you will need to open one file for input and one for output, use the LINE INPUT # and PRINT # methods to read & write 63 (in your case) lines, do what you like with line 64, then loop through reading 65+ and writing same.

  3. #3
    Join Date
    Feb 2006
    Location
    malaysia
    Posts
    25
    Quote Originally Posted by gupex
    If the lines are of equal length you can open a file for Random with LEN=nnn, and then specifically reference any record.

    However, if they are not the same length, you will need to open one file for input and one for output, use the LINE INPUT # and PRINT # methods to read & write 63 (in your case) lines, do what you like with line 64, then loop through reading 65+ and writing same.


    can i have the sample code to do this program.plz help me it is urgent.
    still new to vb

  4. #4
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    As suggested in my earlier post, there are 2 different methods depending on the structure of the file you are trying to change. If you can idicate which type you are using (fixed length records, or variable length, then I can provide a little more info.

    In either case, if you type each of the words 'Random' and 'Input' and press F1 for Help, you will receive more info. If you do this and still have a problem, then let us know what problem you are still having.

  5. #5
    Join Date
    Feb 2006
    Location
    malaysia
    Posts
    25

    Unhappy

    hi here the file content(all together 92 line)

    'LANGUAGE=ENU
    'SERVERNAME=172.30.253.18
    Public Sub Main()

    '## cvs_cmd_begin
    '## ID = 2001
    '## Description = "Report: Historical: Designer: GAR TAC MC Table Sept 2001: Export Data"
    '## Parameters.Add "Report: Historical: Designer: GAR TAC MC Table Sept 2001: Export Data","_Desc"
    '## Parameters.Add "Reports","_Catalog"
    '## Parameters.Add "2","_Action"
    '## Parameters.Add "1","_Quit"
    '## Parameters.Add "Historical\Designer\GAR TAC MC Table Sept 2001","_Report"
    '## Parameters.Add "1","_ACD"
    '## Parameters.Add "1110","_Top"
    '## Parameters.Add "1140","_Left"
    '## Parameters.Add "9585","_Width"
    '## Parameters.Add "8955","_Height"
    '## Parameters.Add "The report Historical\Designer\GAR TAC MC Table Sept 2001 was not found on ACD 1.","_ReportNotFound"
    '## Parameters.Add "*","_BeginProperties"
    '## Parameters.Add "11;19","Main Splits/Skills"
    '## Parameters.Add "11;19","Other Splits/Skills"
    '## Parameters.Add "1/11/2006-1/14/2006","Dates"
    '## Parameters.Add "1","Day Shift"
    '## Parameters.Add "1","Night Shift"
    '## Parameters.Add "*","_EndProperties"
    '## Parameters.Add "*","_BeginViews"
    '## Parameters.Add "*","_EndViews"
    '## Parameters.Add "C:\Documents and Settings\wooi\Desktop\EOW-4.txt","_Output"
    '## Parameters.Add "44","_FldSep"
    '## Parameters.Add "0","_TextDelim"
    '## Parameters.Add "True","_NullToZero"
    '## Parameters.Add "True","_Labels"
    '## Parameters.Add "True","_DurSecs"

    On Error Resume Next

    cvsSrv.Reports.ACD = 1
    Set Info = cvsSrv.Reports.Reports("Historical\Designer\GAR TAC MC Table Sept 2001")

    If Info Is Nothing Then
    If cvsSrv.Interactive Then
    MsgBox "The report Historical\Designer\GAR TAC MC Table Sept 2001 was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
    Else
    Set Log = CreateObject("AVSERR.cvsLog")
    Log.AutoLogWrite "The report Historical\Designer\GAR TAC MC Table Sept 2001 was not found on ACD 1."
    Set Log = Nothing
    End If
    Else

    b = cvsSrv.Reports.CreateReport(Info,Rep)
    If b Then

    Rep.Window.Top = 1110
    Rep.Window.Left = 1140
    Rep.Window.Width = 9585
    Rep.Window.Height = 8955



    Rep.SetProperty "Main Splits/Skills","11;19"

    Rep.SetProperty "Other Splits/Skills","11;19"

    Rep.SetProperty "Dates","1/11/2006"

    Rep.SetProperty "Day Shift","1"

    Rep.SetProperty "Night Shift","1"




    b = Rep.ExportData("C:\Documents and Settings\wooi\Desktop\EOW-4.txt", 44, 0, True, True, True)





    Rep.Quit



    If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Rep.TaskID
    Set Rep = Nothing
    End If

    End If
    Set Info = Nothing
    '## cvs_cmd_end

    End Sub


    i just want read the line 64 and change the date
    Rep.SetProperty "Dates","1/11/2006"


    i no idea how to do this.plz guide me thanks.

  6. #6
    Join Date
    Feb 2004
    Location
    Sydney, Australia
    Posts
    498
    There are a lot of 'commented' lines, but even so, I can't find any reference to 'cvsSrv' so ....I might/must be missing something.

    Phil, Marco, Paul, etc .... over to you ...

Similar Threads

  1. Route Printer.Print to specific printer
    By Don in forum VB Classic
    Replies: 1
    Last Post: 09-01-2005, 12:58 PM
  2. Replies: 1
    Last Post: 03-11-2002, 10:03 PM
  3. Re: [OT] Please Change Subject Line In Replies
    By Patrice Scribe in forum .NET
    Replies: 0
    Last Post: 08-07-2001, 10:26 AM
  4. Please Change Subject Line In Replies
    By Tomas in forum .NET
    Replies: 0
    Last Post: 08-07-2001, 09:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center