I saved a config file as config.yaml, but it ended up as config.yaml.txt. Is there a quick way to fix it or prevent it next time?
How do I stop Notepad adding .txt to a YAML file?
Answers
In PowerShell, go to the folder containing the file and run Rename-Item -Path 'config.yaml.txt' -NewName 'config.yaml'. That changes the filename, not the contents of the file.
Reply to this answer
For next time, put the filename in quotes in Notepad's Save As filename box: "config.yaml". That tells the save dialog to use the name as typed instead of tacking on .txt.
8g!socketmarble_471:
That sounds handy. I keep forgetting to change the file type before saving.
Reply to this answer
Another option in Save As is to change the file type dropdown from text documents to All Files, then enter config.yaml without quotes. Either way, check the resulting filename if you're unsure.
Reply to this answer
You can rename it in File Explorer too. Turn on file extension display first so you can see the extra .txt, then remove just that part. Otherwise it can be easy to end up with an unexpected extension.
Reply to this answer
Add your answer
Answers are reviewed before publication.
4e+drimvoro_392:
You can also use mv in PowerShell, as in mv config.yaml.txt config.yaml.