Skip to content

imaaryan/Image-Extractor-from-CSV-Excel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Extractor from Excel

A powerful and efficient Node.js utility that automates the process of downloading images from URLs listed in an Excel spreadsheet. This tool organizes downloaded images into folders based on your specified categorization, making it perfect for bulk image management, e-commerce product asset organization, and data collection tasks.

🚀 Features

  • Bulk Image Downloading: Process hundreds of image URLs from a single Excel file.
  • Smart Organization: Automatically creates folders based on row data and saves images within them.
  • Intelligent File Naming: Renames images sequentially (e.g., image_1.jpg, image_2.png) to maintain order.
  • Format Detection: Automatically detects image file extensions from URLs or Content-Type headers.
  • Error Handling: Skips invalid URLs without stopping the entire process and logs errors for review.
  • Sanitized Folder Names: Ensures folder names are safe for the file system by removing invalid characters.

📋 Prerequisites

Before you begin, ensure you have the following installed on your machine:

  • Node.js (Version 14 or higher recommended)
  • npm (Node Package Manager)

🛠️ Installation

  1. Clone the repository or download the source code.

  2. Navigate to the project directory in your terminal.

  3. Install dependencies:

    npm install

📖 Usage

  1. Prepare your Excel file:

    • Create an Excel file named input.xlsx in the root directory.
    • The first column should contain the names of the folders you want to create.
    • The subsequent columns should contain the image URLs.
    • Note: The first row is treated as a header and skipped if the first cell is "FolderName".

    Example Structure:

    FolderName Image1 URL Image2 URL ...
    Product_A http://example.com/img1.jpg http://example.com/img2.png ...
    Product_B http://example.com/img3.jpg ...
  2. Run the script:

    npm start
  3. Check the output:

    • A downloads folder will be created in the project root.
    • Inside, you will find subfolders corresponding to the names in your Excel file, containing the downloaded images.

⚙️ Configuration

  • Input File: The script looks for input.xlsx by default.
  • Output Directory: Images are saved to the downloads directory.

To change these defaults, you can modify the INPUT_FILE and DOWNLOAD_DIR constants in index.js.

📂 Project Structure

├── index.js                # Main script file
├── package.json            # Project dependencies and scripts
├── input.xlsx              # (User provided) Input data file
└── downloads/              # (Generated) Output directory for images

📄 License

This project is licensed under the ISC License.

About

A powerful and efficient Node.js utility that automates the process of downloading images from URLs listed in an Excel spreadsheet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors