Mod:Hunt Research Group/Windowsfiles

From wiki
Jump to navigation Jump to search

How to... fix files that come from a windows machine

In case you ever copied a plain ASCII textfile from a windows machine to the Cluster (especially happens, if it ends on *.com) you might have noticed that G03 will not accept it though it may look fine in VI.

This is most likely due to the fact that the linefeed is coded in as it would be for Windows, which is different to a linefeed in UNIX (Look it up in the Wikipedia).

To fix this, most unix machines provide a command called 'dos2unix'. Simply run dos2unix [filename] and your file will be converted.

In case you wonder: Most sFTP/SCP programs will take care of this problem for you. But to do this, they need to know that they are dealing with a text file, not a binary. This is usually done based on the file extension. So if you had renamed your file to *.txt, copied it to the HPC and then named it back, it would already have been converted... If you suspect the conversion to be a problem, open your file in VI. The status line at the bottom of the screen should read [DOS] (among other things...).