Jump to content

[Windows] Fix for .cfgs/.txts not displaying returns in notepad


JumpsterG

Recommended Posts

As you explored your Part .cfgs have you ever been frustrated by one that opened like this?

badNotepadView.png

Wouldn't you rather it open like this?

GoodNotepadView.png

This is a simple problem caused by opening text files in Windows notepad that were originally created in Linux or Mac OSX. When it comes to denoting new lines, Notepad is expecting a Carriage Return followed by a Line-Feed (2 characters), but other O/S's don't bother with the Carriage Return, using just a single Line-Feed. This stumps poor notepad and leaves you resorting to Notepad++ or other means to view and edit these files.

Sure it's not that big a deal, but if you like the simplicity of opening all your text files in notepad, maybe give this a try:

UtilityScreenshot.png

It's a dirt-simple utility that takes in either a single file or your entire KSP folder, cleans up the newlines, and spits out notepad-readable .cfgs, .crafts, and .txts. This will affect all files with these extensions, no matter how deeply nested they are in subfolders. Technically, you can use this utility for any file or folder, so keep it in mind if you run into the same problem elsewhere!

Download via dropbox: CleanNewlines

Source (VB.NET Solution) included in download. License is free for all (redistribute, repurpose, modify at will).

:)

Edited by JumpsterG
Updated to affect .craft files
Link to comment
Share on other sites

This works wonders for .craft files that have the same issue -- though the renaming scheme doesn't know how to handle the *.craft filenaming convention, which is easily fixed by renaming the file after conversion.

I hadn't thought about that! I'll try to update when I get home tonight to include .craft files in the folder-wide conversion. Maybe reword it so it's clear you can use any folder and that it affects all subfolders, no matter how deeply nested they are.

[Edit] And done! Now back to the headache that is Orderly Parts. I once created a Pascal code parser in college, so you'd think something as simple as a Part .cfg would be nothing... :P

Edited by JumpsterG
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...