One more question, i need to change the loop
name;num_tel;num_fixe;id_client;num_comd;email;city;date_liv
gwenael;0998452223;1038431234;50C;12345;gwa@yahoo.fr;London;08/07/2015
marcel;0966442312;1038453211;31C;654321;marcel@yahoo.fr;Pairs;08/06/2015
judith;0954674487;1045227937;23D;78965;judith@yahoo.fr;Toulouse;11/05/2015
paul;0998452223;1038431234;35X;19945;paul@yahoo.fr;Bordeaux;01/04/2015
toto;0966442312;1038453211;31Z;994991;toto@yahoo.frNice;02/12/2015
marie;0954674487;1045227937;23C;78944;marie@yahoo.fr;Lille;04/08/2015
jacque;0998452223;1038431234;77C;18845;jacque@yahoo.fr;Bruges;09/05/2015
trucmuche;0966442312;1038453211;31Z;666321;trucmuche@yahoo.fr;Berlin;10/04/2015
tata;0954674487;1045227937;23D;77965;tata@yahoo.fr;New-york;08/07/2015
i have to modifiy the awk script in fact using a loop for does not permish to do
what i need.
1) I need to change the loop for to a if condition because in the action i will have to
add tag name in the script in order to frame tag name from the csv.
for example in the script i will have which is not
in the csv to frame which is
in the csv to output in xml.
2) User can add tags in the csv with the default tags name before it is generated.
for exemple let's consider that tags city and date_liv had been added by user
so they took position after the default tags of the csv (column 7 and 8).
So how is it possible to add them with a loop starting at column 7 to the end to the xml ?
3) is it possible to rename a tag ? for exemple num_comd by command.
<rows>
<C = id_client>
<client>
<identity>
<name>
<M>
<num> </num>
<num_tel> </num_tel>
<num_comd> </num_comd>
</M>
</identity>
<locomotion>car</locomotion>
</client>
</C>
</rows>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…