Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am using QV for sports analysis reports
Currently, I get data from 2 separate sources which export the data as .csv files
For csv file 1, I use the following to import the csv
FROM
[$(vPATH)\*.csv]
(txt, unicode, embedded labels, delimiter is '\t', msq);
This does not pick up csv file 2
For csv 2 I have to use the following to import the csv (When using this path, QV does not pick up csv file 1
FROM
[$(vPATH)\*.csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Is there a way for QV to pick up both types of CSV files I Have attached samples of both csv files
Hi
I think ,its not possible . you have to load one by one only..
Hello!
So, why are you can't load from both files and concatenate it?
load *
FROM
[$(vPATH)\FILE1.csv]
(txt, unicode, embedded labels, delimiter is '\t', msq);
concatenate
load *
FROM
[$(vPATH)\FILE2.csv]
(txt, unicode, embedded labels, delimiter is '\t', msq);
Hi there,
Your path is the same, but is seems that the files are not similar as the third lie of code differs for both of them. If you can align them, you could load multiple csv-files one after another in the same script.
I have it in an application scripted by someone else, and it works fine. Below is the syntax, it may help you.
for each FileExtension in 'qvd'
for each FoundFile in filelist( '$(vQVDPath)\Fact\'& 'Travel aggregate_*.' & FileExtension)
Filelist:
LOAD DISTINCT
Class,
%TempProdKey,
[%Sales Channel]
FROM [$(FoundFile)] (qvd);
next FoundFile
next FileExtension
Regards,
Johan
Hi
see Rob Wunderlich's post in this thread
"What I do is test the first character of the logfile with various encodings to see if I can interpret it as a number. When I get a positive I use that encoding to read the file. Probably would break if someone used a MMM-DD-YYYY format, but haven't had a complaint (yet). Here's the relevant code that determines the encoding."
FOR EACH vEncoding IN 'utf8', 'unicode', 'codepage is 1252'; TempCode: FIRST 1 // Log first row LOAD IsNum(left(@1:n,1)) as X // Test first char. Set to true if it's a number. FROM [$(_logpath)] (fix, $(vEncoding)) ; EXIT FOR WHEN peek('X'); // If a number, assume we have the right encoding. NEXT vEncoding;