UT11111 Smith Joe "CN=XXX UT11111 OU=Something OU=XXX OU=Somewhere OU=Something O=Something"
I have a file with many records like this. I need to insert a comma between the first and second field and the second and third field only so it will look like:
UT11111,Smith Joe, "CN=XXX...
The version of nawk I am using does not produce anything. I downloaded the gnu version of grep and the command is hanging:
sed -n 's/.*,CN=\([^,]*\).*/^\1 /p' editable_langs_new | /usr/local/bin/grep -f - user_truck_list >user_truck_list_new
Any help would be appreciated.
The nawk command runs but produces a 0 byte file when piped with >>final at the end. If I run it without piping it to a file it just returns to a command prompt.
I get syntax errors with the awk statement and the lovely bailing out at line ...
On the sed command, my grep does not have a -f option. This is Sun 2.9.
My use of awk is rather limited.
I have tried awk -F "CN=M" ' {print $2}' editable_langs_new >/tmp/test
but so far, nothing is working. I'll keep tryping. Thanks for the help.
I have 2 files with many rows:
First is called Edit_new and has records like:
CN=XXX,CN=M123456,OU=XXX,OU=XXX,OU=XXX,O=XXX,en-du
CN=XXX,CN=M654321,OU=XXX,OU=XXX,OU=XXX,O=XXX,en-vu
Second is:user_list and has records like:
M123456 John Brown
M804420 Alice Cooper
M654321 Joe Bell
What I need is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.