Skip to content

Sometimes Excel or Notepad will not recognize whitespaces when you try to remove extra spaces in an entire column of data, or a dataset. So this script file in the code will help remove those white spaces, it converts them to "?" characters, which can then be manually removed.

License

Notifications You must be signed in to change notification settings

hassanaftab93/CSV-White-Space-Remover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSV File White Space Remover

How to remove whitespace from CSV file?

Before we explain that, why do we want to do that? Sometimes Excel or Notepad will not recognize whitespaces when you try to remove extra spaces in an entire column of data, or a dataset.

So this script file in the code will help remove those white spaces, it converts them to "?" characters, which can then be manually removed.

  • Clone Repo
  • Rename your CSV File into "file.csv"
  • Run Script
  • Open the new CSV File generated by the script
  • CTRL+H to open Find and Replace Window
  • Replace all "?" with "".

Remove leading and trailing spaces from CSV file with PowerShell to get the PowerShell script to work.

Run Locally

  • Rename your CSV file to "file.csv"

  • Clone the project

  git clone https://github.com/hassanaftab93/CSV-White-Space-Remover
  • Go to the project directory Manually or Run the Command
  cd c:/path/to/script
  • Execute the Command
  ./WhiteSpaceRemover.ps1
  • Or you can right click on the File and select Run with Powershell

  • If the Powershell returns an error about Execution Policy not allowing Windows to execute Powershell Scripts then do the following:

    • Start Powershell in Admin Mode
    • Run this command:
  Set-ExecutionPolicy RemoteSigned

Releases

Contributing

Contributions are always welcome!

Authors

🔗 Links

portfolio linkedin

About

Sometimes Excel or Notepad will not recognize whitespaces when you try to remove extra spaces in an entire column of data, or a dataset. So this script file in the code will help remove those white spaces, it converts them to "?" characters, which can then be manually removed.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published