Results 1 to 22 of 22

Thread: [RESOLVED] Read Text file and make changes

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2012
    Posts
    58

    Resolved [RESOLVED] Read Text file and make changes

    I am in need of programming in VB on a simple project.

    Few files r enclosed along the mail

    I tried to make the program but am not able to proceed ahead
    Please check me file.
    What u need to do
    Create a folder c:\sunil
    Copy the test.txt file there
    Use the frm to make exe, select the file test click at the bottom on check box
    Press convert, the result file will also go to c”\sunil.

    Here the test .txt file has only 4 cloumns and I just needed to add 0.5 to the last value--------------easy

    What I need

    I need to use the same type by reading a file as “000_1642.RAW”
    Program should Read the whole file
    Wherever it finds EC1 then in that line in the last figure it should add 0.5 (text2.text)
    Rest of the file should remain same

    Like below

    FTP NEW 2
    VER 6.2.2.8
    INF "" "" "" "" 0.000 0.000 0.000
    FIL "" "C:\HYPACK\Projects\JAIGAD\DREDGING CHANNEL.lnw"
    ELL WGS-84 6378137.000 298.257223563
    PRO TME xxxxx 75.000000 0.999600 0.000000 0.000000 0.000000 500000.0000 0.0000
    DTM 0.00 0.00 0.00 0.00000 0.00000 0.00000 0.00000
    GEO ??? 0.000
    HVU 1.0000000000 1.0000000000
    TND 16:42:00 11/10/2011 -330
    DEV 0 32868 "Nmea 0183" 49156 C:\HYPACK\devices\nmea.dll 6.2.7.25l
    OFF 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000
    DEV 1 16 "Echotrack GLDD" 512 C:\HYPACK\devices\echotrackgldd.dll 6.2.1.3
    OFF 1 0.000 0.000 0.000 0.000 0.000 0.000 0.000
    EOH
    EC1 1 60118.328 5.280------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60118.497 5.370------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60118.666 5.310------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60118.835 5.310------------------------------ this value should be added by 0.5 or whatever given in text2.text
    POS 0 60118.811 310607.431 1915392.695
    QUA 0 60118.811 4 9.100 0.900 9.000 2.000
    RAW 0 60118.811 4 171896.15000 731307.65000 -74.40000 111206.00000
    EC1 1 60119.005 5.340
    GYR 0 60118.974 91.000
    EC1 1 60119.174 5.340------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60119.344 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60119.513 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60119.682 5.370------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60119.851 5.370------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60120.021 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
    POS 0 60119.867 310606.888 1915391.409
    QUA 0 60119.867 4 9.100 0.900 9.000 2.000
    RAW 0 60119.867 4 171896.08000 731307.62000 -74.40000 111207.00000
    EC1 1 60120.190 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
    EC1 1 60120.359 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
    FIX 99 60120.500 739

    Till end of file and save the file in c:\sunil by the same name


    Can you please help me by making it possible
    Thanks in advance
    mail me on Email Address Removed By Mod
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width