Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Encoding applied to csv file

  • 29-07-2019 11:39AM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2, Paid Member Posts: 1,711 ✭✭✭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.

    I subscribed to keep boards.ie alive!
    boards.ie: Now Ye're Subscribing



  • Registered Users, Registered Users 2 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, Registered Users 2, Paid Member Posts: 1,711 ✭✭✭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.

    I subscribed to keep boards.ie alive!
    boards.ie: Now Ye're Subscribing



  • Registered Users, Registered Users 2 Posts: 36,095 ✭✭✭✭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