Forum Discussion

ggzmorsh's avatar
ggzmorsh
Helper II
6 years ago

Connecting to a folder with CSV files without separating commas

Before creating a thread I have tried searching for previous threads that have been solved and none of them seems to fit to what i am having trouble with.

 

Simply i need to add a data source folder that contains csv files and connect them to power bi. The problem is however power bi is splitting all commas(default delimiter for csv) which makes all columns have commas split into parts. An example of this would look like

NameAgeBlood TypeAddress
Frank21O#2, someaddress, some city
Jonathan22B-antartica

 

 

And power bi will split them to

NameAgeBlood TypeAddress
Frank21O#2
someaddress   
some city   
Jonathan22B-antartica

 

What do i need to do? Some of the solutions from different threads are from 3 years ago, and some steps do not work anymore.

3 Replies

  • If you exporting it from some source then you can force the string to be enclosed in " or can use tab-delimited.

    • ggzmorsh's avatar
      ggzmorsh
      Helper II

      changing the delimiter to something else combines all columns into one

       

      Column1

      Name,Age,Blood Type,Address
      Frank,21,O,"#2, someaddress, some city"
      Jonathan,22,B-,antartica

       

      Then i still need to separate them based on the delimiter commas. It would look like this now.

      NameAgeBlood TypeAddress
      Frank21O#2, someaddress, some city
      Jonathan22B-antartica

       

      Which yes, solves this problem IF we are talking about one file. If the data source contains more than one combining them also includes the headers and when you split them makes the problem worse.

       

  • mussaenda's avatar
    mussaenda
    Community Champion

    ggzmorsh,

     

    you can set it before loading the csv on power bi,

     

    You can choose which delimiter you are going to choose and there is also a preview of the data after choosing the delimiter you need