this is my file
$ cat testjson2
[alot of text]
I would like to end up with below: ({ "aaData":
append at the start of the file }
appended at the end of the file)
{ "aaData": [alot of text] }
What I have got so far:
this does the appending at the start of the file
$ sed '1s/./{ "aaData": &/' testjson2
{ "aaData": [alot of text] }
this does the appending at the end of the file
$ echo } >> testjson2
$ cat testjson2
[alot of text]
}
How do I combine them? maybe just using sed or should i just use this combination to get what I want? just looking at using sed awk or bash here.