Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use a text input to define another file to reference? bob Excel Discussion (Misc queries) 5 October 6th 08 03:35 PM
How to import a text file to Excel treating all input content are in string. Chittu Excel Discussion (Misc queries) 1 July 22nd 05 06:37 AM
Excel VBA- Get user input, search the for match, output to text file gnileo Excel Programming 1 January 8th 04 07:59 PM
Opening a text file for input [email protected] Excel Programming 5 January 8th 04 05:11 AM
Input from Text file BOMB3RMAN[_4_] Excel Programming 2 November 4th 03 03:00 AM


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"