Skip to content

A very specific script for a very specific use case I encountered at work, where I need to adjust the cells in a certain Excel column such that no line exceeds a certain character limit.

License

Notifications You must be signed in to change notification settings

mahmoudadelaziz/XLSX-column-line-width-fixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XLSX Column Width Fixer

A simple Python command-line tool that stops your Excel column from looking like a scrunched-up mess.

The Problem

Ever open an Excel file or a report, and all the columns are way too narrow? You can't read any of the data, and you have to spend the next 10 minutes manually double-clicking every. single. column. header. It's boring, and it's a waste of time.

Before: image

The Solution

This script does that boring part for you.

It loops through every column and every row in your .xlsx file and automatically sets the width or height to perfectly fit the text inside. Just run it, and you're done.

After: image

🚀 How to Use

It's super simple.

1. Clone this repo:

git clone [https://github.com/mahmoudadelaziz/XLSX-column-line-width-fixer.git](https://github.com/mahmoudadelaziz/XLSX-column-line-width-fixer.git)
cd XLSX-column-line-width-fixer

2. Run the script!

Just point the script at the file you want to fix.

python main.py your_messy_file.xlsx messy_column_name [optional: w- <desired line width>]

# example:
python main.py messy_file.xlsx random_coumn -w 30

That's it! The script will create a new file called your_messy_file_width_adjusted.xlsx in the same folder, all nicely formatted.

Want to contribute?

Feel free to fork the repo and submit a pull request. If you find a bug or have an idea, please open an issue!

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A very specific script for a very specific use case I encountered at work, where I need to adjust the cells in a certain Excel column such that no line exceeds a certain character limit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages