At my work I am having a somewhat particular issue; we work with map data and some of the current map data is incorrect/inconsistent. I have a Mapfil.txt file that contains all of the information related to a particular segment. A segment is a line (representing a road) that goes from (x1, x2) and (y1, y2). A road going left -> to right. The segments on the left are going in the right direction and the address #'ing is correct, the segments on the right are going in the wrong direction but the address #'ing is correct. What is incorrect are the 'RH,LH, RL, LL' field values on each node. These values are individual and separate from the address values; these 'RH, LH...' values are used in order to determine the direction of the segment. What I am trying to do is compare the values of LL to RH, and if RH is > LL, place the value of RH into LL variable... and do the same with the other fields, if LH < RL then RL = LH & LH = RL
Make the value in Left Low be Right High | Make the value in Left high be Right Low
LL ===> RH LH ===> RL
Make the value in Right low be Left High | Make the value in Right High be Left Low
RH ===> LH RH ===> LL
The text file that I am to work with is formatted like so... but the data I will be working with will have columns that extend into the thousands. The LH, LL, RH, LH columns have room for 9 characters and they will very so I have to account for that when going through and capturing the data My plan of attack goes something like:
1. read through all of the data and capture each specific column into its own variable
- 1169(LL) = LL
- 1141(LH)= LH
- 1168(RL) = RL
- 1148(RH)= RH
2. Once I have all of the data inside of their own variables, then do an if / else statement that compares the value of the LL to RH and if LL is > RH then I want to assign LL the value of RH, essentially just switching the column values of Left Low to be the new values of Right High.
3. Do this if / else statement to every value and have it spit out the results into a text file.
Is this possible with a DOS BATCH file?
if this is possible, how best to separate each column into its own specific variable in order to run an if / else?
I did my best to describe this issue in full, and I know it is kind of a weird / obnoxious one, but any and all help/guidance is appreciated thoroughly
