I have a file with records (lines) having two types of field delimiters |
and !
as given below:
Name|Age|Physics|Chemistry|Maths|English|Batch!Year!AdmisnNo!Grade!Score
Student1|81|65|70|80|88|EWS!2021!1001!A!75
Student2|72|63|60|50|75|EWS!2021!1002!A!85
Student3|72|63|60|50|75|EWS!2021!1002!A!85
How to merge Batch
, Year
and AdmisnNo
fields as given below?
Note, for brevity I have shown a small list of useful fields, where as my real files have many such related fields. This field where I want to remove two or three !
marks is not the last one and can be any field (6 or 7 ) from a total number of fields around 49.
Name|Age|Physics|Chemistry|Maths|English|BatchYearAdmisnNo!Grade!Score
Student1|81|65|70|80|88|EWS20211001!A!75
Student2|72|63|60|50|75|EWS20211002!A!85
Student3|72|63|60|50|75|EWS20211002!A!85
I requested awk
, however any reasonably standard command is welcome.