I have a few JSON files, the structure varies slightly (can have multiple "Columns")
but they look like this:
[{"data":"redacted1","type":"unknown"},{"data":"","type":"unknown"},{"data":"[email protected]","type":"email"}]
[{"data":"redacted2","type":"unknown"},{"data":"","type":"unknown"},{"data":"[email protected]","type":"email"}]
[{"data":"redacted3","type":"unknown"},{"data":"","type":"unknown"},{"data":"[email protected]","type":"email"}]
I want to replace the "type" with my own value, the third data pointer is email, the first one is name, and the middle one is junk, the third one already has a value.
So i want it to look like this:
[{"data":"redacted1","type":"name"},{"data":"","type":"junk"},{"data":"[email protected]","type":"email"}]
[{"data":"redacted2","type":"name"},{"data":"","type":"junk"},{"data":"[email protected]","type":"email"}]
[{"data":"redacted3","type":"name"},{"data":"","type":"junk"},{"data":"[email protected]","type":"email"}]
How can i do this with JQ?