Skip to main content
added 2 characters in body
Source Link
LPChip
  • 62.4k
  • 10
  • 101
  • 146

Here's a neat little trick that is very handy when working with CSV files created elsewhere and you want to seamlessly import them into excel.

Open the .csv file with notepad (or notepad++), like you already did so you can edit its content.

Now, At the very first row, press enter to insert a blank row.

Now type in the following:

sep=,

sep as in separator, and the , is the separator you use. Ignore the use or lack of "", excell will understand. The ,, can of course also be ;; if the excelcsv uses that.

Save the file back either to the same file, or as a new one.

If you now open the new file, excel opens it correctly.

Your example file would look like this:

sep=,
AAAAA,BBBBB,CCCCC,DDDDD
"a2",b2,c2,d2
a3,"b3",c3,d3
a4,b4,"c4","d4"
a5,"this, works",c5,d5
"oh, no",b6,c6,d6

Also, if you now distribute the new .csv file to others, their excel will also automatically open it correctly. You can also choose to open it yourself, and then save as .xlsx file. That way, it is also compatible with other editors, such as Open Office Calc, libre office, etc...

It is technically also possible to create a script that automatically inserts sep=, to the start, so you can send that script to people who have trouble opening .csv files.

Here's a neat little trick that is very handy when working with CSV files created elsewhere and you want to seamlessly import them into excel.

Open the .csv file with notepad (or notepad++), like you already did so you can edit its content.

Now, At the very first row, press enter to insert a blank row.

Now type in the following:

sep=,

sep as in separator, and the , is the separator you use. Ignore the use or lack of "", excell will understand. The , can of course also be ; if the excel uses that.

Save the file back either to the same file, or as a new one.

If you now open the new file, excel opens it correctly.

Your example file would look like this:

sep=,
AAAAA,BBBBB,CCCCC,DDDDD
"a2",b2,c2,d2
a3,"b3",c3,d3
a4,b4,"c4","d4"
a5,"this, works",c5,d5
"oh, no",b6,c6,d6

Also, if you now distribute the new .csv file to others, their excel will also automatically open it correctly. You can also choose to open it yourself, and then save as .xlsx file. That way, it is also compatible with other editors, such as Open Office Calc, libre office, etc...

It is technically also possible to create a script that automatically inserts sep=, to the start, so you can send that script to people who have trouble opening .csv files.

Here's a neat little trick that is very handy when working with CSV files created elsewhere and you want to seamlessly import them into excel.

Open the .csv file with notepad (or notepad++), like you already did so you can edit its content.

Now, At the very first row, press enter to insert a blank row.

Now type in the following:

sep=,

sep as in separator, and the , is the separator you use. Ignore the use or lack of "", excell will understand. The , can of course also be ; if the csv uses that.

Save the file back either to the same file, or as a new one.

If you now open the new file, excel opens it correctly.

Your example file would look like this:

sep=,
AAAAA,BBBBB,CCCCC,DDDDD
"a2",b2,c2,d2
a3,"b3",c3,d3
a4,b4,"c4","d4"
a5,"this, works",c5,d5
"oh, no",b6,c6,d6

Also, if you now distribute the new .csv file to others, their excel will also automatically open it correctly. You can also choose to open it yourself, and then save as .xlsx file. That way, it is also compatible with other editors, such as Open Office Calc, libre office, etc...

It is technically also possible to create a script that automatically inserts sep=, to the start, so you can send that script to people who have trouble opening .csv files.

Source Link
LPChip
  • 62.4k
  • 10
  • 101
  • 146

Here's a neat little trick that is very handy when working with CSV files created elsewhere and you want to seamlessly import them into excel.

Open the .csv file with notepad (or notepad++), like you already did so you can edit its content.

Now, At the very first row, press enter to insert a blank row.

Now type in the following:

sep=,

sep as in separator, and the , is the separator you use. Ignore the use or lack of "", excell will understand. The , can of course also be ; if the excel uses that.

Save the file back either to the same file, or as a new one.

If you now open the new file, excel opens it correctly.

Your example file would look like this:

sep=,
AAAAA,BBBBB,CCCCC,DDDDD
"a2",b2,c2,d2
a3,"b3",c3,d3
a4,b4,"c4","d4"
a5,"this, works",c5,d5
"oh, no",b6,c6,d6

Also, if you now distribute the new .csv file to others, their excel will also automatically open it correctly. You can also choose to open it yourself, and then save as .xlsx file. That way, it is also compatible with other editors, such as Open Office Calc, libre office, etc...

It is technically also possible to create a script that automatically inserts sep=, to the start, so you can send that script to people who have trouble opening .csv files.