DEV Community

Amaljit Bharali
Amaljit Bharali

Posted on

BatchScript: FolderCreatorTool using csv

🧰 KPT-0002 | Create Folders from an Excel .csv File Using a Simple Batch Script

πŸ”’ Post ID: KPT-0002

If you loved the trick in KPT-0001, here’s an even smoother one β€” using a .csv file instead of a .txt.

We’ll still use the same .bat file approach, but this time we’re giving users the power of Excel + CSV to manage folder paths quickly.


🎯 What This Script Does

  • Uses a .csv file containing folder paths (e.g., India\Assam\Kamrup)
  • Runs a lightweight .bat script to create those folders instantly
  • Works on any Windows PC β€” no installations, no admin rights, no extras

πŸ–±οΈ Just double-click the .bat file

πŸŽ‰ Boom! Your folders appear like magic

πŸ—ƒοΈ It's automation, the old-school way β€” fast, clean, and offline


πŸ“ Real Use Case: What If Your Data Isn’t Ready?

In government offices (like mine!), most Excel files look like this:

State District
Assam Kamrup
Assam Jorhat
Assam Sivasagar
Assam Dibrugarh
Assam Nagaon

But our batch script can’t work with two columns β€” it needs a single folder path like:

India\Assam\Kamrup
India\Assam\Jorhat
India\Assam\Sivasagar
Enter fullscreen mode Exit fullscreen mode

πŸ› οΈ Excel Hack to Fix This

Here’s a quick Excel formula that combines columns into paths:

If your data is in columns A and B:

=TEXTJOIN("\", TRUE, "India", A2, B2)
Enter fullscreen mode Exit fullscreen mode

Or, for older Excel:

="India\" & A2 & "\" & B2
Enter fullscreen mode Exit fullscreen mode

πŸ’‘ Paste this in Column C and drag down β€” copy the result into a .csv, and you’re done.


πŸ—‚οΈ Example Folder Paths

India\Assam\Kamrup
India\Assam\Jorhat
India\Assam\Sivasagar
India\Assam\Dibrugarh
India\Assam\Nagaon

πŸ“„ Download example_government_folder_data.csv


πŸ™Œ Wrapping Up

This CSV method is great for:

  • Government departments
  • Office record keeping
  • Anyone organizing district/state-wise data

It brings your Excel database to life in your Windows folders.


πŸ“₯ Get the Files

πŸ“ Download Script & Sample CSV (.ZIP)


πŸ“š Explore more tools:

━━━━━━━━━━ 𖀓 THE KRITTIKA PROJECT 𖀓 ━━━━━━━━━━

✍️ Written by Amaljit Bharali | β˜„οΈ Krittika Guides Me | The Rover Builds | 2025

Top comments (0)