Hi Mohamed,
There will be two files created out of the input file that you have provided. The input file is the file which will be used for creation of links between the sites. You need to create another file which will be the sites file out of this file as it is having both the site information in the input file start_x,start_y will be the first site and end_x,end_y will be the second site location which we will use in create points.
To accomplish this you need to take out the site information from the input file. We will first query and select all columns except the end_x,end_y in our first query and then save it as sitepart1. We need to make another query this time all columns except the start_x and start_y and save it as sitepart2.
Now we open both the tables and append them and save it as sites table.Below is the code snippet.
Select BTS_CODE, Start_X, Start_Y, BSC_CODE, Type1, Type2, HOP, LOS from inputtable into s1
Select BTS_CODE, End_X, End_Y, BSC_CODE, Type1, Type2, HOP, LOS from inputtable into s2
savepath = pathtodirectory$(sinputfile)+"sitepart1.tab"
Commit Table s1 As savepath TYPE NATIVE Charset "WindowsLatin1" Interactive
Open Table savepath Interactive
savepath = pathtodirectory$(sinputfile)+"sitepart2.tab"
Commit Table s2 As savepath TYPE NATIVE Charset "WindowsLatin1" Interactive
Open Table savepath Interactive
Close Table s1 Interactive
Close Table s2 Interactive
Insert Into sitepart1 ( COL1, COL2, COL3, COL4, COL5, COL6, COL7, COL8) Select COL1, COL2, COL3, COL4, COL5, COL6, COL7, COL8 From sitepart2
Commit Table sitepart1 Interactive
savepath = pathtodirectory$(sinputfile)+"sites.tab"
Commit Table sitepart1 As savepath TYPE NATIVE Charset "WindowsLatin1" Interactive