I can not figure out, how to use sed or awk to trim string in file. I've been searching many hours without desired result. I have a string like this:
c=one, o=roll, root ca valid until: date
c=one, o=roll, root ca Located: location
c=two roll, root ca valid until: date
c=two roll, root ca Located: location
My desired output align in columns:
c=one valid until: date
c=one Located: location
c=two roll valid until: date
c=two roll Located: location
I'm using sed command which does not work like (and many others):
sed 's/,.*\^([valid])//g' file.txt
but I can't figure out second condition until word "valid", in addition "valid" and "Location" at the same command. Thanks a lot!