How can I find and replace data with mask data in calc? ie Phone number masking last 4 digits

I have a list of contacts I need to pass on to a private individual and I do not want to reveal all the information as it could be used inappropriately if it leaves my control.

I am trying to prove I have a large contact list but mask out some of the data such as partial phone numbers, email addresses, last names and addresses. Just to show enough information to prove it exists (so it doesn’t look like its a created out of nothing list) but not enough it could be copied and used to someone else’s benefit.

There’s thousands of lines in a CSV spreadsheet. Only have a few columns. So if I need to make a custom script or something for each criteria, that’s okay.

In my example:
Columns are: Comapny,FirstName,LastName,Address,City,Phone,EmailAddress,Website

And since a lot of the list is not companies and are private individuals, it further increases my need to mask information.

A Company Name John Doe 1234 Some Street Address In-A-City 555-555-5555 an-email-address@someserver.something www.websiteaddress.domain

I would want to partially mask some of the information with x’s and truncations.

Replace the last name like Dxx
Replace the address with a truncation like 1234 Some…
Replace the phone number with 555-555-xxxx
Replacing and truncation of an email address with ad…s@somese…
Replacing the website address with a truncation like www.webs…

Thanks muchly!!

I’d use regular expressions and replacer in columns (selection only).

For last name, I’d search for (\b[[:alpha:]]x*)[^x ]([^ ]*)$ and replaced with $1x$2 until no more occurrences are found in the column. (This replaces one character in last name with x each time.)

For phone numbers, I’d use ([[:digit:]]{3}-[[:digit:]]{3}-)[[:digit:]]{4} and replaced with $1xxxx.

Addresses: ^(.{9}).*$$1...

Emails: ^(..).*(.@.{6}).*$$1...$2... (this ignores the count of characters in email, just replaces any count of characters with ellipsis).

Websites: ^(.{8}).*$$1...

And, of course, check the data manually afterwards, to make sure that everything is as you need. No advise here has any kind of guarantee, so using anything is your own risk. No responsibility taken.