Need to import csv list of menu groups

charliec

New Member
I need to import a text file with new menus group permissions. I have exported and edited 2700 lines and now want to import. Does anyone have an example of a query for how to do this. The file is formated like so:

Menu Sel Sort Index Index 2 Selection Label Exec File Access codes
0 0 0 Main Menu 0 * *
1 10000 0 Progress Editor * GP1
2 20000 0 Main Menu A * *
0 1 1000000 0 Items/Sites 1 * *
0 2 2000000 0 Addresses/Taxes 2 * *
 
Using MS-Excel, import your text file.

Take a look to each step for excel import wizard.

When you done, you will have a sheet, ok? So, save as CSV(MS-DOS)*.csv.

Thk.
 
I was not clear enough

No sorry maybe I was not clear enough. I want to import into QAD to reset the groups assigned to the menus.
 
something similar I did

Here is something I wrote when I need to update our permissions.
The csv had three columns: menuselectioncanrun
and the table that was updated was: mnd_det.
Notes:
1. I just updated existion records of this table.
2. In the csv file I replaced the comma between the groups(the third column) with '|' and then in the program I replaced it back to be comma as it suppose to be.

Here is the code, hope it would help:



def var i as int.

def var inp as char format "x(100)".

def temp-table f-file

field f-menu as char

field f-sel as int

field f-canrun as char.



input from "C:\SecureUs.csv".

import unformatted inp.



repeat:



import unformatted inp.



create f-file.

assign

f-menu = entry(1,inp)

f-sel = integer(entry(2,inp))

f-canrun = entry(3,inp).

end.



input close.

for each f-file:

f-canrun = replace(f-canrun,"|", ",").

end.



output to "C:\NotExistMenu.txt".

put "Menu|Selection|CanRun|" skip.

for each f-file no-lock:



find first mnd_det exclusive-lock

where mnd_nbr = f-menu and mnd_select = f-sel no-error.



if avail mnd_det then do:

assign

mnd_canrun = f-canrun.

end.



else do:

put f-menu "|" f-sel "|" f-canrun "|" skip.

end.





end.

output close.
 
Back
Top