Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Csv splitting issue

Hi,   Im trying to split an exported csv file in power query. The split works for thousands of rows, but for some reason, few random rows do not react to the split, despite having the exact same de...
  • Anonymous's avatar
    Anonymous
    6 years ago

    In my experience, this problem usually occurs because the csv does not have properly quoted delimiters AND one of the fields contain a carriage return or line feed. I get around this issue by opening the file without delimiters and then using the SplitColumn function in PQ. Now you should be able to find the records causing the issue and handle accordingly.

     

    Regards,

    Mike

     

    let
    
    Source= Table.FromColumns({Lines.FromBinary(File.Contents("C:\Transform Directory\Velocity Reports\12 + Month Reports\Bulk and Count Velocity.txt"), null, null, 1252)})
    
    SplitCol= Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter(",", QuoteStyle.None), {"Column1.1", "Column1.2"})
    
    in SplitCol