How can I create schema.ini file? I need to export my .csv file to datagridview

前端 未结 2 1177
夕颜
夕颜 2020-12-19 17:21

I want to export a CSV file to a datagridview. I need to create the file schema.ini. But I don\'t know, how can I create it?

There is my code:



        
2条回答
  •  清酒与你
    2020-12-19 17:56

    I wrote these Excel formulas to generate the content of this file if you can get hold of the Excel sheet with column headers. It's pretty basic. Add and remove features as desired. It assumes all text with delimiters. Then insert the following formula (including all your options) in A2:

    ="[no headers.csv]
    "&"ColNameHeader=false
    "&"MaxScanRows=0
    "&"Format=Delimited(;)
    Col"&COLUMN()&"="&A1&" text
    "
    

    And the following formula in B2.

    =A2&"Col"&COLUMN()&"="&B1&" text
    "
    

    Then drag to the right to get your basic schema.ini (rightmost cell). You can adjust options in the excel cell below the column name. Each column has it's own definition. I got closing and opening quotes in the result when copied to text file.

提交回复
热议问题