Console.clear'Create Variablesdim MyFile, MyLine, MyArray, i, X, Y'Create File ObjectSet myFile = Application.CreateAppObject("File")'Open the Text FileMyFile.Open "C:\Temp\Goofa.txt"'Now loop through until you get to the end of the fielWhile not MyFile.EOF 'Set the vaiable of each line MyLine = MyFile.ReadLine 'Set the Array Up by splitting the line of Text by a comma MyArray = Split(MyLine, ",", -1, 1) 'Now look at each part of the text string to pull out the coordinates For i = 0 to UBound(MyArray) 'Console.print("i: " & i & " == " & MyArray(i)) If i = 11 then 'These values refer to my data. Use the Console.print to find out which section you need for the coordinates. X = MyArray(i) End If If i = 12 then Y = MyArray(i) End If Next 'Create the shapefile Point from the coordinates of each line without showing the EditForm Call Map.AddFeatureXY(X, Y, False)WendMsgBox "Done"
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.