I'm trying to mask PII in a file (.json).
The file contains different email addresses and I would like to change them with other different email addresses.
For example:
"results":
[{ "email1@domain1.com",
"email2@domain2.com",
"email3@domain3.com",
"email4@domain4.com",
"email5@domain5.com" }]
I need to change them to:
"results":
[{ "mockemail1@mockdomain1.com",
"mockemail2@mockdomain2.com",
"mockemail3@mockdomain3.com",
"mockemail4@mockdomain4.com",
"mockemail5@mockdomain5.com" }]
Using sed and regex I have been able to change the addresses to one of the mock email addresses, but I would like to change each email to a different mock email.
The mock email addresses are stored in a file. To get a random address I use:
RandomEmail=$(shuf -n 1 Mock_data.csv | cut -d "|" -f 3)
Any ideas? Thanks!