Forum Discussion
Dealing with Large Datasets
smpa01 I have a similar issue with a large data set that I want to try to create dimenstion tables from, but it's in CSV format. Is there a way to pull select columns and distinct values of those columns from a CSV file?
AnonymousI experimented with a CSV file.
Following is the syntax
Csv.Document(File.Contents("C:\Users\x\Desktop\csv.csv"),[Delimiter=",", Columns=2, Encoding=65001, QuoteStyle=QuoteStyle.None])Is there a way to pull select columns - yes, you can do that by mentioning th number of columns you want by overwriting in Columns=2. But I guess the column selection works from left to right and you can't do a SQL like SELECT to choose your columns.
and distinct values of those columns from a CSV file? - since a SQL statement will not work, I doubt whether it is possible to run additional scripting.
Please read to understand the parameters allowed inside CSV.Document
https://docs.microsoft.com/en-us/powerquery-m/csv-document
You can try connecting it through ODBC connector and there you can fully utilize SQL statements