.cv issue

skunal

Member
I have a file which has 58 comma seperated values. And also there will be files which have more values.
If the file has more columns then 58 then it should display wrror message.
I have used the code by taking the array of 58 and importing it.But if i take array of 58 even if tough records are there i cant have them and i cant do validation.
Is there any way such that i can pick only single value from record at a time from input file .csv and increment the counter and then check for validation
def var a as char extent 58 no-undo.
def var i as int no-undo.
input from value("abc.csv").
Repeat:
import delimiter "," a.
disp a.
i = i + 1.
End.
input close.

This code gives the value of one record full but i want to check the value one by one and keep the counter so that file wont have more records and display error message .....
 
input from value("abc.csv").
Repeat:
import unformatted a.
disp a.
n = num-entries (a).
if n > 58 then error.
do j = 1 to n:
value = entry(j,a).
end.
i = i + 1.
End.
input close.
 
Top