Ok, so how many times have you received this request? I have been looking through the forum for examples and I see the use of tr, awk and sed to perform similar functions but not sure how to use the tools in this scenario and could use a push in the right direction.
GOAL:
Search for line breaks and replace with a unique delimiter to import into excel
IDEALLY, create headers with the first part of each line (auth user, description, role) but I can manually remove by doing a search and replace like I will do with the last character { in auth user.
DATA: useraudit.txt
auth user SVC_Qualys {
description "SVC_Qualys"
role guest
auth user admin {
description "Admin User"
role admin
auth user svc_redseal {
description "svc_redseal"
role resource-admin
In my newbie ways I am trying to approach it step by step so first try and get everything on one line so I created users.awk
Ran awk -f users.awk useraudit.txt and I get
auth user SVC_Qualys {, description "SVC_Qualys", role guest
Not sure yet how to edit the results for the desired goal... I'll keep plugging away
Thank you for the community help. This forum has been a big help and I love the different ways people take to approach for a solution.
Sorry Rudi... I pasted the content in the first post.. i suppose i should of just attached the txt file.
contents of useraudit.txt
auth user SVC_Qualys {
description "SVC_Qualys"
role guest
auth user admin {
description "Admin User"
role admin
auth user svc_redseal {
description "svc_redseal"
role resource-admin
I want to use your code but I'm obviously doing something wrong.
I copied your entire code, placed it in a file called test.awk and changed file to useraudit.txt which contains all the user information that we want to export