I have a file which lists grantees, their privileges and whether or not they are admin. This is proving difficult to import due to each grantee having a different number of privileges which revert to the row underneath (see below). I have replaced the actual usernames with 'user 1' etc...
GRANTEE PRIVILEGE ADMIN
---------------------------------------- ---------------------------------------- ------
USER 1 CREATE SESSION NO
UNLIMITED TABLESPACE NO
USER 2 CREATE SESSION NO
SELECT ANY DICTIONARY NO
SELECT ANY TABLE NO
UNLIMITED TABLESPACE NO
USER 3 CREATE SESSION NO
SELECT ANY TABLE NO
UNLIMITED TABLESPACE NO
USER 4 CREATE SESSION NO
SELECT ANY TABLE NO
UNLIMITED TABLESPACE NO
I would like the final structure to be something like the below, where the data is separated into columns with the headers GRANTEE, PRIVILEGE and ADMIN. I have been able to replace the separators with pipes, but am then stuck on what to do next as there is no fixed number of privileges per user, therefore counting the pipes is a non-starter. Can anyone suggest a way of importing this please?
