The input for this script will be a .csv file which looks like the following.
"Pin Number","Pin Name","Direction"
"10","OTW#","O"
"4","OUTL+","O"
"5","OUTL+","O"
"6","OUTL+","O"
"1","OUTL-","O"
"2","OUTL-","O"
"3","OUTL-","O"
"8","TEST0","I"
"7","TEST1","I"
the output should look like the following
TEST0 =8 =L= =I=
TEST1 =7 =L= =I=
OUTL_PP =4 =R=OUTL+ =O=
OUTL_PP =5 =R=OUTL+ =O=
OUTL_PP =6 =R=OUTL+ =O=
OUTL_MM =1 =R=OUTL- =O=
OUTL_MM =2 =R=OUTL- =O=
OUTL_MM =3 =R=OUTL- =O=
Based on the direction all the inputs with letter "I" are grouped first then outputs "O" are grouped.
The " symbol is replaced as =
The , should be replaced as some blank space
The + sholud be replaced as PP
The - sholud be replaced as MM