Hey folks,<br><br>So I'm still working on my awk skills. I'm trying to write a script that allows me to pase a csv file of user rights and get all users that have a specific right. Then using that list of users find all other rights those users have.<br>
<br>Ex CSV:<br><br>UserName,Right<br>Bob,Add<br>Ben,Add<br>Ben,Delete<br>Tommy,Add<br>Sarah,Delete<br>Sarah,Edit<br><br>My result set if I search for users with Delete should look like<br><br>Ben,Delete<br>Sarah,Edit<br><br>
This is what I have so far<br><br>BEGIN { FS = "," }<br><br>/Delete/ { Users[$1]=$2 }<br>/Delete/ {print $1, " - ", Users[$1]}<br><br>This gets me the list of all users with Delete and prints it for me. I've been tinkering with a few ways to iterate through the array but I can't seem to figure out how to do it. I think it requires two passes through the file, one to generate the user list and one to generate the rights list, but I'm kinda stuck. Anyone have any ideas.<br>
<br>Will Weaver<br>