+ Reply to Thread
Results 1 to 3 of 3

dynamic input from a text file pavement elevations

Hybrid View

  1. #1
    John Coon
    Guest

    dynamic input from a text file pavement elevations

    Hi,

    I'm looking for a sample that can insert a comma delimiter see sample. The
    first entry is the station along a baseline and the second is the elevation
    at that baseline location. What I'm trying to do is read a comma delimiter
    file and have the routine load the centerline elevation column and then
    populate the
    remaining fields based on the fields above table. I have some experience
    with vba in autocad but none in excel. I can create the command dialog to
    point to the text file but I don't know how to direct it to the centerline
    column. If I can get the data in the correct column my next question is how
    can I make the routine dynamic so that if I change a value in the values
    above the table and have it fire and repopulate the data.

    Thank you for any comments or direction you can provide.

    John Coon

    'and then open the text file containing the station/elevation data
    Dim dblSta as double
    Dim dblelev as double
    intInputFile = FreeFile()
    Open "c:\temp\profile.txt" For Input As intInputFile

    Do While Not EOF(intInputFile)
    'read 2 sequential, delimited values from the input file and store them
    as station/elevation data
    Input #intInputFile, dblSta, dblelev

    75 = width
    1.5 = grade
    100= percent divided by
    0.015 = grade in decimal
    1.125 = width x grade decimal, difference in elevation

    75 1.5 100 0.015 1.125 1.5
    Station Left Offset 3 Left Offset 2 Left Offset 1 Centerline Elevation
    Right Offset 1 Right Offset 2
    2952.63 0.00 0.00 22.75 23.87 0.00 0.00
    2808.85 0.00 0.00 23.16 24.28 0.00 0.00
    3389.09 0.00 0.00 24.16 25.28 0.00 0.00

    sample:
    2952.63, 287.63
    2808.85, 309.59
    3389.099, 309.59




  2. #2
    Jim Thomlinson
    Guest

    RE: dynamic input from a text file pavement elevations

    Take a look at the split function. It takes a single line of input from your
    CSV file (which you already have) and converts it into an array, which you
    can deal with.

    HTH

    "John Coon" wrote:

    > Hi,
    >
    > I'm looking for a sample that can insert a comma delimiter see sample. The
    > first entry is the station along a baseline and the second is the elevation
    > at that baseline location. What I'm trying to do is read a comma delimiter
    > file and have the routine load the centerline elevation column and then
    > populate the
    > remaining fields based on the fields above table. I have some experience
    > with vba in autocad but none in excel. I can create the command dialog to
    > point to the text file but I don't know how to direct it to the centerline
    > column. If I can get the data in the correct column my next question is how
    > can I make the routine dynamic so that if I change a value in the values
    > above the table and have it fire and repopulate the data.
    >
    > Thank you for any comments or direction you can provide.
    >
    > John Coon
    >
    > 'and then open the text file containing the station/elevation data
    > Dim dblSta as double
    > Dim dblelev as double
    > intInputFile = FreeFile()
    > Open "c:\temp\profile.txt" For Input As intInputFile
    >
    > Do While Not EOF(intInputFile)
    > 'read 2 sequential, delimited values from the input file and store them
    > as station/elevation data
    > Input #intInputFile, dblSta, dblelev
    >
    > 75 = width
    > 1.5 = grade
    > 100= percent divided by
    > 0.015 = grade in decimal
    > 1.125 = width x grade decimal, difference in elevation
    >
    > 75 1.5 100 0.015 1.125 1.5
    > Station Left Offset 3 Left Offset 2 Left Offset 1 Centerline Elevation
    > Right Offset 1 Right Offset 2
    > 2952.63 0.00 0.00 22.75 23.87 0.00 0.00
    > 2808.85 0.00 0.00 23.16 24.28 0.00 0.00
    > 3389.09 0.00 0.00 24.16 25.28 0.00 0.00
    >
    > sample:
    > 2952.63, 287.63
    > 2808.85, 309.59
    > 3389.099, 309.59
    >
    >
    >
    >


  3. #3
    John Coon
    Guest

    Re: dynamic input from a text file pavement elevations

    Jim,

    Thanks I'll take a look at that function.
    If I can split the text file how do I direct the split text elements to the
    proper column?

    Have a great day.
    John Coon
    "Jim Thomlinson" <JimThomlinson@discussions.microsoft.com> wrote in message
    news:8854A931-2CB5-481C-9747-A9C528599A2C@microsoft.com...
    > Take a look at the split function. It takes a single line of input from
    > your
    > CSV file (which you already have) and converts it into an array, which you
    > can deal with.
    >
    > HTH
    >
    > "John Coon" wrote:
    >
    >> Hi,
    >>
    >> I'm looking for a sample that can insert a comma delimiter see sample.
    >> The
    >> first entry is the station along a baseline and the second is the
    >> elevation
    >> at that baseline location. What I'm trying to do is read a comma
    >> delimiter
    >> file and have the routine load the centerline elevation column and then
    >> populate the
    >> remaining fields based on the fields above table. I have some experience
    >> with vba in autocad but none in excel. I can create the command dialog
    >> to
    >> point to the text file but I don't know how to direct it to the
    >> centerline
    >> column. If I can get the data in the correct column my next question is
    >> how
    >> can I make the routine dynamic so that if I change a value in the values
    >> above the table and have it fire and repopulate the data.
    >>
    >> Thank you for any comments or direction you can provide.
    >>
    >> John Coon
    >>
    >> 'and then open the text file containing the station/elevation data
    >> Dim dblSta as double
    >> Dim dblelev as double
    >> intInputFile = FreeFile()
    >> Open "c:\temp\profile.txt" For Input As intInputFile
    >>
    >> Do While Not EOF(intInputFile)
    >> 'read 2 sequential, delimited values from the input file and store
    >> them
    >> as station/elevation data
    >> Input #intInputFile, dblSta, dblelev
    >>
    >> 75 = width
    >> 1.5 = grade
    >> 100= percent divided by
    >> 0.015 = grade in decimal
    >> 1.125 = width x grade decimal, difference in elevation
    >>
    >> 75 1.5 100 0.015 1.125 1.5
    >> Station Left Offset 3 Left Offset 2 Left Offset 1 Centerline
    >> Elevation
    >> Right Offset 1 Right Offset 2
    >> 2952.63 0.00 0.00 22.75 23.87 0.00 0.00
    >> 2808.85 0.00 0.00 23.16 24.28 0.00 0.00
    >> 3389.09 0.00 0.00 24.16 25.28 0.00 0.00
    >>
    >> sample:
    >> 2952.63, 287.63
    >> 2808.85, 309.59
    >> 3389.099, 309.59
    >>
    >>
    >>
    >>




+ 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