Hello gurus;
I need to do a script to complete a technical template and I don't have idea to how to do :wall: I've try with bash and awk or sed but my brain is empty in this script. I need help please.
The incoming file is a csv with an index number, first occurence in the possition of the element, the number of line for the element, type of element and name of the element, this is an example of imput file:
1;0;1;Service;TEST Operating;;;;;;;;;;;;;;;;;;;
2;1;1;System;LoadBalancer_5;;;;;;;;;;;;;;;;;;;
3;2;1;System;HTTP_Server_4;;;;;;;;;;;;;;;;;;;
4;3;1;System;AS_KXKK1;;;;;;;;;;;;;;;;;;;
5;4;1;System;LDAP;;;;;;;;;;;;;;;;;;;
6;5;1;Component;LDAP;;;;;;;;;;;;;;;;;;;
7;4;2;Component;p_TEST;;;;;;;;;;;;;;;;;;;
8;4;3;Component;WASSRV5;;;;;;;;;;;;;;;;;;;
9;3;4;System;AS_KXKK2;;;;;;;;;;;;;;;;;;;
10;4;4;System;LDAP;;;;;;;;;;;;;;;;;;;
11;5;4;Component;LDAP;;;;;;;;;;;;;;;;;;;
This is an explanation of the first line of the imput file:
INDEX;POSSITION_IN_LINE;NUMBER_OF_LINE;TYPE_OF_ELEMENT;ELEMENT
1;0;1;Service;TEST Operating;;;;;;;;;;;;;;;;;;;
The idea is generate an output file with all type of elements and elements filled and if no previus element in the line is complete i need put the same element that is in the upper row:
1;Service;TEST Operating;System;Loadbalancer_5;System;HTTP_Server_4;System;AS_KXKK1;System;LDAP;Component;LDAP;;;;;;
2;Service;TEST Operating;System;Loadbalancer_5;System;HTTP_Server_4;System;AS_KXKK1;Component;p_krex;;;;;;;;
3;Service;TEST Operating;System;Loadbalancer_5;System;HTTP_Server_4;System;AS_KXKK1;Component;WASSRV5;;;;;;;;
4;Service;TEST Operating;System;Loadbalancer_5;System;HTTP_Server_4;System;AS_KXKK2;System;LDAP;Component;LDAP;;;;;;
The line one puts each possition, the first line is easy because I have all elements with the "NUMBER_OF_LINE" field but in the rest of lines I don't have idea that how complete with the rest of elements.
Please help me
I've attached two example files to try explain better that my english sorry for that.
May thats for your time.
Ren