Git Product home page Git Product logo

Comments (9)

jeroen avatar jeroen commented on May 26, 2024

Please provide a reproducible example of the file that you generated.

from writexl.

hidekoji avatar hidekoji commented on May 26, 2024
airlines <- readr::read_csv(file="https://www.dropbox.com/s/xkznuhtokjmjomh/airline_delay_2016_09.csv?dl=1")
writexl::write_xlsx(airlines, path='~//Downloads/text.xlsx', col_names=TRUE);

This generates 39.3MB xlsx file. But if you open it with Excel or Number and re-saved it as Excel without changing anything, the file reduced to 4.7MB

from writexl.

jeroen avatar jeroen commented on May 26, 2024

I cannot reproduce this problem. If I opentest.xlsx in excel and then resave it, the size actually increases to 41.4MB. I'm using excel 2016 for mac (v15.41).

from writexl.

nacnudus avatar nacnudus commented on May 26, 2024

I also cannot reproduce this problem. Resaving it in various formats with Excel 2013 for PC (v14.0760):

  • xlsx = 41 MB
  • xlsb = 18 MB
  • csv = 40 MB
  • csv zipped = 7.9 MB
  • xls = 16 MB (which truncates the data to 65536 rows)

from writexl.

hidekoji avatar hidekoji commented on May 26, 2024

ok, could you please try this?

  1. On Mac, with Numbers open the xlsx file generated with writexl::write_xlsx
  2. Without changing anything, export as Excel.

Then you'll get xlsx file with 4.7MB. Here is the xlsx file.

https://www.dropbox.com/s/pgqf0fzn682g2od/test-reduced.xlsx?dl=0

from writexl.

nacnudus avatar nacnudus commented on May 26, 2024

@hidekoji This is what happens for me.

  1. Download the file from dropbox, which is 4.6 MB.
  2. Import it into R with readxl.
  3. Write it to a new xlsx file with writexl::write_xlsx, which creates a 5.1 MB file.
  4. Open that 5.1 MB file in Excel 2013 for PC and resave it, which creates a 6.0 MB file.

Are you using the lateset version of writexl?

from writexl.

Giaino78 avatar Giaino78 commented on May 26, 2024

Finally, no answer to this question? I have the same issue. I download a .xlsx file, size 500KB, after opening and saving it without any changes the size increase at 1400KB.
What can I do?

Thanks for any kind of help

from writexl.

jeroen avatar jeroen commented on May 26, 2024

Can you provide an example file and the exact code that you run, so that we can test the problem?

from writexl.

jmcnamara avatar jmcnamara commented on May 26, 2024

I think this issue should be closed.

The underlying libxlsxwriter library specifically aims to produce xlsx file that are the same as the files produced by Excel. There may be differences in overall size caused by the zip library and compression level but these shouldn't be anything other than +/- 10%. Also, the same mechanism is used in the libxlsxwriter sister libraries of XlsxWriter in Python and Excel::Writer::XLSX in Perl and this issue is never reported there.

Finally, I tried to reproduce with the the file provided by @hidekoji above and cannot:

4.5M  test-reduced.xlsx    # Original
6.3M  test-reduced2.xlsx   # Resaved in Excel 2011
4.5M  test-reduced3.xlsx   # Opened in Numbers and reserved as an xlsx file

Other people in the thread have also pointed out that they cannot reproduce this so I think it should be closed.

from writexl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.