I need to generate a single file based on the all the city states file I have in one directory. For example I have the file emp-name-irving-texas.grammar. I need to get the following output based on the file name:
(irving texas IRVING-TEXAS:n) {<city irving><state texas><vid $n>}
Similarly if I have the file emp-name-newyork-newyork.grammar the output would be:
Please note upper case also.
(newyork newyork NEWYORK-NEWYORK:n) {<city newyork><state newyork><vid $n>}I have to get the following output
I need to keep appending this output to one single file.
So the final file needs to look like:
[
(irving texas IRVING-TEXAS:n) {<city irving><state texas><vid $n>}
(newyork newyork NEWYORK-NEWYORK:n) {<city newyork><state newyork><vid $n>}
]
([ is appened at the top of the file and ] is appended at the end of the file.)
How may I do this in awk?
(irving texas IRVING-TEXAS:n) {<city irving><state texas><vid $n>}
Similarly if I have the file emp-name-newyork-newyork.grammar the output would be:
Please note upper case also.
(newyork newyork NEWYORK-NEWYORK:n) {<city newyork><state newyork><vid $n>}I have to get the following output
I need to keep appending this output to one single file.
So the final file needs to look like:
[
(irving texas IRVING-TEXAS:n) {<city irving><state texas><vid $n>}
(newyork newyork NEWYORK-NEWYORK:n) {<city newyork><state newyork><vid $n>}
]
([ is appened at the top of the file and ] is appended at the end of the file.)
How may I do this in awk?