Carbide Motion should ignore ASCII 26 (0x1a) DOS end-of-file character

I sometimes get files that end with a single DOS end-of-file character (coming from other programs). Carbide Motion chokes on these, it should simply ignore the character completely.

Could you please send such a file (and notes on the CAM tool which created it) to us at — we’ll do our best to have a developer look into it.

I was using F-Engrave, but I needed multiple passes to get the depth I wanted. So, I create two files (one for each depth) and concatenated them together into one long file.

I used the cmd.exe ‘copy’ command, as so:

For some reason, the copy command appends a DOS EOF marker when concatenating files together. I’ve changed how I concatenate these files, but Carbide Motion really should just ignore the EOF marker completely.

I’ve incuded an artificial example, but the problem appears regardless of the contents of file1 and file2 (32 Bytes) (32 Bytes) (65 Bytes)

If you can find a normal CAM tool which creates such a file we’ll formally log it — not sure that it warrants addressing otherwise, but that’s up to the developers.

@mhotchin if the devs to not address your request I believe there are flags (/a and /b) that can be added to the copy command to avoid the EOF characters.

copy /a file1.txt + file2.txt file3.txt /b

Maybe worth trying that out.

EDIT: the /b flag indicates it’s a binary file so does not append the EOF character to terminate the file.

1 Like

@mhotchin actually looks like .nc files are actually ascii files so if the above does not work maybe worth trying

copy /a file1.txt + file2.txt file3.txt /a (indicating ASCII files input and ASCII files output), no harm in trying.

I just have Microsoft notepad set as my default program to open .nc and .gcode files, and do the good ol’ copy-paste to merge, modify or otherwise combine two or more g-code files. It also has a simple but functional find/replace to speed up or slow down the feeds if necessary without having to go back in the house to fire up whatever CAM program I used to generate the g-code.

So above you mentioned using the copy command in cmd.exe. I just downloaded your files (, and and when I open the file in notepad I noticed there’s a 3rd line in the file with the EOF character (a rectangular box). So I went in cmd.exe and used the following

copy /a /b

notice the use of the /a and /b in the copy command. When I did this and then opened the file in notepad that character on the 3rd line was gone so maybe that’s the work around if you still want to use the “copy” command in cmd.exe.


This topic was automatically closed after 30 days. New replies are no longer allowed.