0

I have some questions about the .cfg file format.

How can I open it and how can I edit the file so that it is still usable?

If I search on the internet for a .cfg file editor I didn't find anything usable. I tried to edit it in Notepad or Wordpad it becomes unusable and if I use Free File Viewer I only can read it, but not editing.

Does anyone knows a good editor, so that the file is still usable after editing?

Jarne
  • 25
  • 1
  • 9

2 Answers2

1

This is probably a question for another forum than Serverfault, but simply put: .cfg is not a single well-defined file format, though you can usually assume it's a plaintext configuration file with human-readable contents.

From your question I assume it's a file for a Windows-based software. In that case Notepad is the easiest built-in way not to introduce problems. Just remember the following:

  1. Notepad by default adds a .txt extension to file names. You need to Save as... and switch the Save as type field to All files (*.*)in the save dialog before storing the file with a .cfg suffix.

  2. Windows by default hides file suffixes, so unless you take the previous step, files will look as though they have a .cfg suffix in the File Explorer/Computer view, but will in fact have a hidden .txt suffix and not be read by the software.

I suspect these two points explain why you couldn't get a (presumably correctly formatted) config file to work with your program.

Once you've outgrown Notepad, there's a bunch of editors to choose from:

  • Notepad++ (as mentioned by @Norbert Weuster) is a nice pretty lightweight tool.
  • Many programmers like to use the Sublime text editor, which can be used in a free mode but becomes a lot more powerful if you pay for it.
  • If you can live with Electron apps (as opposed to native ones), Visual Studio Code is a pretty decent-looking "free" text editor.
Mikael H
  • 5,031
  • 2
  • 9
  • 18
  • My cfg file comes from a ENVIROMUX-16D devices. Which is probably Windows based but I am not sure. I can open the file in Notepad and I see the configuration in plain text but with some strange characters and white space. I think my file is probably formatted with some strange charset. How can I see which charset is used? – Jarne Dec 20 '19 at 13:28
0

I like Notepad++ very much.

It might help you in converting and encoding charsets and linefeeds.

Norbert Weuster
  • 181
  • 2
  • 8
  • If I use Notepad++ I get lots off `NUL` and `SOH` values in my file, but also some readable text, but lots off `NUL` values. – Jarne Dec 20 '19 at 13:50
  • Then it is not a common ASCII editable config file and I would try to touch it unless there is an application specific editor or special tool. – Norbert Weuster Dec 22 '19 at 21:13