I am trying to print all data between double quotes ( sampleField="sampleValue"), but I find it hard to get awkand / or sub/ gsubto return all instances of data between double quotes. Then I would like to print all the instances in the corresponding lines that they found in order to save the data together.
Here is an example file input.txt:
deviceId="1300", deviceName="router 13", deviceLocation="Corp"
deviceId="2000", deviceName="router 20", deviceLocation="DC1"
The result I'm looking for is:
"1300", "router 13", "Corp"
"2000", "router 20", "DC1"
I'm having trouble using gsub to delete all data between ,and =. Each time I tried a different approach, it always just returns the first field and moves to the next line.
UPDATE:
, , . 1, 3 5 000. , , , .