## Posts

Showing posts from October, 2019

### Set default program for opening files without extensions in Windows

For some reason, downloading the request / result CSV files for a Salesforce "Bulk Data Load" job returns CSV files with the file extension missing, so you can't just click to open them. This became super annoying during a troublesome data load so I decided to fix it once and for all.  Open cmd as admin and enter the following:

assoc .="No Extension" ftype "No Extension"="C:\ProgramData\chocolatey\lib\csvfileview\tools\CSVFileView.exe" "%1"

Obviously substitute in your favourite CSV editor (unless by some bizarre coincidence, you also like CSVFileView and install everything with chocolatey).  Credit for the solution goes to this post on superuser.

### Powershell - normalizing line endings for all files in a directory

If you're working with a git repository, a much better way to solve this is by changing the core.autocrlf setting.  In this case I didn't have that option, and needed a quick way to update thousands of files so the EOL chars would match in a binary diff tool.  Here's my slightly modified version of this SO answer: