John, 1234567
Bob, 2839211
Alex, 2817821
Mary, 9371281
I am currently trying to retrieve the first column with the last 4 digits of the second column using sed, so the output should look like this:
John, 4567
Bob, 9211
Alex, 7821
Mary, 1281
This is my command: 's/\(.*,\)\(.*\)//', I think that this command matches the first column until the comma and the second column until the end, but I am unsure on how to continue.