Maker Pro
Maker Pro

Drill file txt conversion

I

Ilija Pavlovic

Jan 1, 1970
0
Traxmaker made txt drill file without last zero(s), but I need full format
like Tango:

T01
X0005Y0005 -> X000500Y000500
X00475Y00555 -> X004750Y005550
Y00585 -> Y005850
Y00615 -> Y006150
Y00645 -> Y006450
Y01 -> Y010000
X011 -> X011000

Please help, how to solve this, maybe C++...

--
Ilija Pavlovic
[email protected]
Phone: 3972 607
Mobile: 0641130744 ili
0646128417
 
M

Meindert Sprang

Jan 1, 1970
0
Ilija Pavlovic said:
Traxmaker made txt drill file without last zero(s), but I need full format
like Tango:

T01
X0005Y0005 -> X000500Y000500
X00475Y00555 -> X004750Y005550
Y00585 -> Y005850
Y00615 -> Y006150
Y00645 -> Y006450
Y01 -> Y010000
X011 -> X011000

Why? Can't you specify the format (2.3 or 2.4 or 2.5 or.....) in the
application that must read the drill file?

Meindert
 
S

Stephan Rose

Jan 1, 1970
0
Traxmaker made txt drill file without last zero(s), but I need full format
like Tango:

T01
X0005Y0005 -> X000500Y000500
X00475Y00555 -> X004750Y005550
Y00585 -> Y005850
Y00615 -> Y006150
Y00645 -> Y006450
Y01 -> Y010000
X011 -> X011000

Please help, how to solve this, maybe C++...

Wouldn't adding zeros in the back change value? wouldn't you want more
zeros in front? Well...either way....here's a C solution for ya...at
least the steps as to how to proceed. :) Writing the code's up to you
:)

Here's what you're gonna have to do.

Read each line...tokenize the string so that you end up with 4 tokens
"X" "0005" "Y" "0005", or 2 tokens in the case of a single coordinate.

Now it's a simple matter of adding 0's to the numeric strings until
the string length is sufficient long enough (6 in your case I guess).

Then just patch it back together into one string, write line to file,
repeat for next line.

Stephan
 
Top