Solução Python:
import re,sys;
for l in sys.stdin:
if 'ADD' in l:
data = [re.split(",",l.rstrip("\n"))[0].split()[-1]]+re.split(",",l.rstrip("\n"))[1:]
print " ".join(data)
data = []
Testado com arquivo personalizado com base no exemplo do OP:
$ cat input.txt
cop1010 ADD atra522,Allison Track,CT,canada
some other stuff
testuser ADD test522,Allison TEST,CT,germany
$ python user_data.py < input.txt
atra522 Allison Track CT canada
test522 Allison TEST CT germany
Para compatibilidade com python 3 e impressão bonita de dados, poderíamos fazer algo assim:
$ cat user_data.py
from __future__ import print_function
import re,sys;
for l in sys.stdin:
if 'ADD' in l:
data = [re.split(",",l.rstrip("\n"))[0].split()[-1]]+re.split(",",l.rstrip("\n"))[1:]
print("Username: " + data[0])
print("Real Name: " + data[1])
print("Some kind of two char string: "+ data[2])
print("Location: " + data[3])
print("- - -")
data = []
$ python user_data.py < input.txt
Username: atra522
Real Name: Allison Track
Some kind of two char string: CT
Location: canada
- - -
Username: test522
Real Name: Allison TEST
Some kind of two char string: CT
Location: germany
- - -