Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Encoding applied to csv file

Options
  • 29-07-2019 11:39am
    #1
    Registered Users Posts: 4,818 ✭✭✭


    I am running a csv from a web based system, reading with excel 2016, and emailing using outlook 2016.

    I know there are various encoding types that are applied to csv files, or can be applied, but at what stage of the file’s lifecycle is the encoding determined?
    -at the time the file is created, and no matter how many people view it under different versions of excel, doesn’t change

    -depending on the last user to open the file and what version of excel they used, encoding constantly changes in background of file format

    -depending on the version of outlook used to actually send the file to the recipient, drives what encoding they see when they open it


Comments

  • Registered Users Posts: 1,703 ✭✭✭JoyPad


    CSV files are essentially text files (comma-separated values). The only encoding that should ever be applied to such a file is Unicode (UTF-8).
    I suspect you are actually using Excel file format (.xls or .xlsx), which is very different, and can cause issues when the files are opened and saved by different versions of Excel.


  • Registered Users Posts: 4,818 ✭✭✭Bateman


    Thanks, that is helpful. I did learn that saving as excel and converting back into csv is not as clean a way of doing it as just creating direct to csv, I want to avoid having to open with notepad++ and converting to csv (that way you actually get to pick the encoding) if at all possible. It is indeed UTF 8 I need to be on it...


  • Registered Users Posts: 1,703 ✭✭✭JoyPad


    I am not a huge consumer of Excel, but I think that CSV is not always suitable. As far as I know, CSV can only contain values, hence the name.

    If you have anything in the spreadsheets that is beyond values, e.g. formulae, graphs, charts, etc, then saving to CSV will lose all that, and only export the values. Re-opening the CSV file into Excel will not bring back the lost stuff, just a table with values inside. Even formatting is lost, as CSV can only carry the data.


  • Registered Users Posts: 36,167 ✭✭✭✭ED E


    Joy is correct, if xsls stores 1000 values than the CSV only stores 100, precisely what you see on screen minus formatting.

    If Alice and Bob and Charlie are all going to do some work on the file you want to leave it as xslx until the final stage where you export it to csv as once you do that data is discarded.

    There's an answer here:
    https://stackoverflow.com/questions/4221176/excel-to-csv-with-utf8-encoding

    If this is your workflow on a daily/weekly basis then setting up a VB macro to do it might be a good solution.


Advertisement