Hello Monks, i've got a bit of a problem here that i need your advice on how to go about it.
I have to create a script, that when operated on specific text files, will be able to read diagrams like those below. It should determine which are left connectors and which are right connectors and associate abbreviated names to the respective connectors, e.g. L1, L2, R2, R5, obviously depending on which side the connector is and how many there are.
[ ABC12 ]----------38.00M----------[ DEF23 ] |---16M------[ DEF23 ] [ ABC12 ]---------- |---16M------[ DEF34 ] [ ABC12 ]-------- | [ ABC23 ]--------|---42m---[ DEF23 ] | [ ABC34 ]--------
The structure is as it appears...bracket, tab, connector id, space, bracket, dashes, length, dashes, bracket, space, connector id, tab, bracket.
It should be able to recognise any number of connectors on each side (1 on left 6 on right, 2 on left 4 on right etc).
Note that there is only one diagram in each text file that is read in.
The length/name of the connector ids, number of dashes denoting the cable & the cable length isn't consistent in any way. The only thing that is consistent is the brackets surrounding the connector ids.
Im having trouble making a program recognise which is on the left and which is on the right. If it were 1 to 1, 1 to 3 etc it would be easy as i would assume for each line, the first '[' it sees belongs to a left connector and the second '[' to a right connector, but you have some lines that only have the right connector on.
Any help/pointers/advice etc anyone can offer is very appreciated. Cheers, Steve
Edit by tye, escape [
In reply to electronic diagram recognisation by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |