On 2017-02-19, dale <
da...@dalekelly.org> wrote:
> I have a bunch of octave, gnuplot and awk files that I made in gedit on
> linux, they only have a linefeed at the end of a line, I would like to
> add a carriage return after each linefeed so I can see them on windows
Learn real editor.
Vim:
:set fileformat=dos
:w
File now saved with CR-LF line endings. Next time you open the file,
Vim will automatically use this fileformat setting.
If you you are just simply using a shared folder between Linux and
Windows, or copying the files back and forth, consider just keeping the
files in Windows format. If Octave and Gnuplot on Linux don't mind
the CR's, you're just fine. Edit in a decent editor and you won't
see the line endings.
Regarding conversion, the manpage for "unix2dos" and "dos2unix".
Another thing: you should consider putting your files into a
cross-platform version control system like Git. A version control system
can create a working copy of text files in the local operating system
format.
You can make a change on Windows to your Octave or Awk code,
commit the change, then push it out to your Linux-side repository
where the update is seen in Unix format.
No software developer worth their salt performs conversions on
their maintained source code between Unix and Windows. Version
control takes care of it.
I wouldn't develop anything other than throwaway code without version
control.