You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

MapObjects -Windows Edition forum

Code to write point shapefile from an ASCII...   Ray Peterson Jul 01, 2002
Re: Code to write point shapefile from an A...   Chris Koverchenko Jul 01, 2002
Re: Code to write point shapefile from an A...   Ray Peterson Jul 01, 2002
Re: Code to write point shapefile from an A...   Chris Koverchenko Jul 02, 2002
Re: Code to write point shapefile from an A...   Ray Peterson Jul 02, 2002
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Code to write point shapefile from an ASCII file 
Author Ray Peterson 
Date Jul 01, 2002 
Message I would like to create a point shape file from an ASCII text file that has lat/long and a few other attributes in it. I would like to use VisBasic 6 to create an exe utility to do this in a batch mode once a day. I was just wondering if somebody already had a nice little program written or some examples that would get me started. Thanks in advance! 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Code to write point shapefile from an ASCII file 
Author Chris Koverchenko 
Date Jul 01, 2002 
Message Here's a sample. You'll need to add more fields to the output table, and put the additional info from each line in the ASCII file into them. Then you can modify it to run as a batch process; perhaps move the code out of a form and into a BAS module starting with a Sub Main, and run the batch process from the command line without a visible form. 
  txt2shp.zip (opens in new window)
 
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Code to write point shapefile from an ASCII file 
Author Ray Peterson 
Date Jul 01, 2002 
Message Thanks for the code! That will get me started. I will need to pull it out of the form and give it a list of files in a batch command list. I also need to figure that out... VB is not one of my strong suits... It will be processing about 10 files a night. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Code to write point shapefile from an ASCII file 
Author Chris Koverchenko 
Date Jul 02, 2002 
Message Take at look at the VB help topic and example for the "Command" function. In the Sub Main where your app starts, use this function to get arguments fed to the app on the command line. In the case of your app, your command line might look something like this:

txt2shape.exe txtfile.txt output.shp

...so your batch file will simply be a list of these "txt2shape.exe" calls. If you don't have the batch file made already, and you only have a list of text files, or a folder full of text files you want converted into shapefiles, then perhaps only have the command line argument give the path of the folder. Then in Sub Main, cycle through that folder, and for each *.txt file, convert it into a shapefile.

txt2shape.exe C:\txtfiles

 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Code to write point shapefile from an ASCII file 
Author Ray Peterson 
Date Jul 02, 2002 
Message Thnaks, will check that out.