Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a table from a CSV file

Hi,

How do I go about creating a table from a CSV file?

Reading data from excel easily enables me to identify the table name from the worksheet name.  However, for CSV or txt files it's not so obvious.

Thanks.

1 Solution

Accepted Solutions
Not applicable
Author

you can yourself assign table name...lets say you are creating a table name called Customer so on the script level you can do it like this..

Customer :

Load feild1, feild2,...

from data.xlx;

store * from Customer into Customer.qvd(qvd);

View solution in original post

9 Replies
Not applicable
Author

Hi,

Can u Attach the CSV file for which u r getting problem.

Not applicable
Author

Hi Pratibha,

I have no issues in uploading the CSV file to QlikView.  However, I want to create a table so I can store this data in a QVD.

I have multiple CSV files to feed into the QVD and my code is set up like this:

For each vFileName in FileList ('C:\My Documents\Data\*.csv')

Directory;

LOAD

.....

FROM [$(vFileName)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

NEXT

STORE tablename$ INTO C:\My Documents\Data\DB.qvd;

DROP TABLE tablename$

However, the tablename$ doesn't appear when I load the data in like an excel spreadsheet.  How do I go about storing each CSV file into a single QVD file?

Thanks.

Not applicable
Author

Hi rkapadia16,

its very easy to create teables or whatever you want to create using csv ot txt files. when loading data just select from the file type delimited and then whater delimeter you are using in your csv you can select with embeded rows or whatever you want..hope it will guide you to the right direction.

Best,

Sam

Not applicable
Author

store into C:\My Documents\Data\DB.qvd(qvd);

just add (qvd) like above.

Not applicable
Author

the right syntax would be...

store * from tablename$ into C:\My Documents\Data\DB.qvd(qvd);

Not applicable
Author

How do I assign this to a table?  It's because in the loading script it doesn't tell me what the table name is.

Not applicable
Author

you can yourself assign table name...lets say you are creating a table name called Customer so on the script level you can do it like this..

Customer :

Load feild1, feild2,...

from data.xlx;

store * from Customer into Customer.qvd(qvd);

Not applicable
Author

Thanks Salman.

This works now.

Not applicable
Author

Bitte schön:)