Issue
In the below, i need to fetch the last item "subnet-0bfc68cb13432a94b" with double quotes with use of awk or sed?
[
"subnet-08585db3344bce1ea",
"subnet-0537a333d2337f361",
"subnet-0bfc68cb13432a94b"
]
Solution
Using any awk:
$ awk -F'"' '/"$/{print $2}' file
subnet-0bfc68cb13432a94b
or any sed:
$ sed -n 's/.*"\(.*\)"$/\1/p' file
subnet-0bfc68cb13432a94b
Answered By - Ed Morton Answer Checked By - Mildred Charles (WPSolving Admin)