Bash script - integrate two files

I wrote script in bash which generates this report "users.csv":

I wrote script in bash which generates this report "groups.csv"

I want to integate two reports: "users.csv" and "groups.csv".
I want like so that "result.csv":

Thx

By what rules are you integrating those two files?
At least to me, it is not obvious how you are ordering your records.

I would use the original data to create the format you want rather than use an intermediate format.

Alternatively, create intermediate files in a format that will be easier to work with.

Hi
users.csv - the first file represents the users from the following groups: @admin, @develop, @progs

groups.csv - the second file represents the groups with the paths and access rights 1 - r, 12 - rw. User9 belongs to group @progs.

The purpose of file result.csv is to present groups with certain paths and rights to paths (12 - rw, 1 - r), for example, @admin;path1;12;;; and users belonging to different groups including the rights of those groups (12 - rw, 1 - r), eg user1;@admin;yes;12;

group @develop has path3, path4, which have 12 oraz 1, respectively, user4 belongs to THIS @develop group and has ALSO rights 12 and 1

Help me please.

Hi patrykxes,

You'll have to be more clearer with the rules on how integrate the 2 files. As of now, I cannot see any clear relationships. Well, I thought I did but then it wasn't. It happened a lot of times and now I have a headache :confused: :slight_smile:

I use this script (awk):

but, this script show the result:

this result above is bad.

I want to integate (first post) two reports: "users.csv" and "groups.csv".
I want like so that "result.csv":
This result is good.

Please.