Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sspawar88
Creator II
Creator II

How can we validate the .csv file on basis of information in .xlsx

Hi,

I have following excel Filestructure.xlsx

Filestructure.xlsx

FilenameFields
Data_Level_*.csvID
Data_Level_*.csvEMP_NAME
Data_Level_*.csvEMP_LOCATION
Data_Level_*.csvCODE


How can we validate the .csv in following folders on the basis of Filename and Fields?

if following csv files doesn't have filename standard and table structure which mentioned in Filestructure.xlsx Qlikview should give the information of compliance in txt

6 Replies
MK_QSL
MVP
MVP

Sorry can't work on whole question..

I can guide you though..

Load your file..

now use something as below

TMP:

NoConcatenate FIRST 1 LOAD * FROM YourFileName.xlsx;

IF FieldNumber (ID) = 0 then Trace....

IF FieldNumber (EMP_NAME) = 0 then Trace....

etc etc

sspawar88
Creator II
Creator II
Author

Sorry to ask you again ! Could you please explain little more?

MK_QSL
MVP
MVP

To validate the fieldname.. load the first line of table/file..

now use FieldNumber Function.. if that field exists then you will get >0 ..

Hope this will make clear..

Kushal_Chawda

what information you want to give in text? like below ?

Number of fields not matched

There is additional column

Field names are different

sspawar88
Creator II
Creator II
Author

Hi Kushal,

Yes this information need to have in txt file.

Please share your approach that would be very helpful.

MarcoWedel

another option to get a list of files and fields contained:

tabCSVFiles:

CrossTable (Field, Value)

LOAD FileName() as File,

    *

FROM [Data_Level_*.csv] (txt, utf8, embedded labels, delimiter is ',', msq)

Where RecNo()=1;

hope this helps

regards

Marco