[Stackoverflow] [Progress OpenEdge ABL] How do I count total lines and create new/Select sheet in one csv file using progress 4GL?

Status
Not open for further replies.
T

Thiru

Guest
I am new to progress 4GL. I have a CSV file that has data for the first 2 rows. 1st-row data is for the list of users and 2nd-row data is for users to be deactivated.

In my program, if I selected flag yes then the program should check the second row in CSV file and store it to a temp table. Please take a look at what I have tried from my side as it is not helping me to focus only on the second row in CSV instead it is taking all the data including 1st-row data as well.

I really appreciate if you tell me how can I create new/move to a sheet(sec) in CSV file and parse the data using progress 4GL

DEFINE TEMP-TABLE tt_sec7Role
FIELD ttsec_role AS CHARACTER.

DEFINE VARIABLE v_dataline AS CHARACTER NO-UNDO.
DEFINE VARIABLE v_count AS INTEGER NO-UNDO.

EMPTY TEMP-TABLE tt_sec7Role.

input from "C:\Users\ast\Desktop\New folder\cit.csv".
repeat:
import unformatted v_dataline.
if v_dataline <> '' then
do:
do v_count = 1 to NUM-ENTRIES(v_dataline,','):
create tt_sec7Role.
ttsec_role = entry(v_count,v_dataline,',').
end.
end. /* if v_dataline <> '' then */
end. /*repeat*/
input close.
v_count = 0.
FOR EACH tt_sec7Role:
v_count = v_count + 1.
END.
MESSAGE v_count.


enter image description here

Continue reading...
 
Status
Not open for further replies.
Top