0
I am not a superuser but more of a supertinkerer. I would like to take a text file, a CNC program to be exact, and extract an 8 digit string from between the known characters of "TxxxxxxxxM6" where T and M6 are known and never change nor do the amount of digits between them. I would use any method reasonable for a newb. I have many files with many tool changes and I want to be able to extract the tool change calls from the nc file and then paste them into text editor or spreadsheet in Windows. Using Windows 10.
Thanks in advance!!!
Welcome to SU. What format is the text file? Is it a CSV? Can you post an example of how it is formatted? – wysiwyg – 2017-05-23T02:56:31.157
format is programname.nc or programname.eia but the extension can be changed to anything if .txt were needed. – Jeremy W. – 2017-05-23T03:03:06.523
can i upload a file? – Jeremy W. – 2017-05-23T03:03:16.703
file will always be similar to this: – Jeremy W. – 2017-05-23T03:07:33.780
(PGM,="943352T)
:128G0G71F3810.T10039401M6 (MSG, ******** ROUGH MILL DATUM -B- B2 LOAD B90 ) G0X-155.Y94.8Z70.231B90.F600.S800T10030001H2M3 Z0.561 G1X0. G2X81.Y13.8I0J13.8 G0Z70.231 Q55 :131G0G71F715.T10030001M6 (MSG, ********ROUGH MILL DATUM -E- A LOAD B180 ) G0X120.958Y18.1Z65.867B180.F485.S765T40043701H5M3 G11E[PCD,5,A]=0L100 M2 – Jeremy W. – 2017-05-23T03:08:58.900
Can you upload the file here: https://uploadfiles.io/
– wysiwyg – 2017-05-23T03:15:01.3701
If your data spans multiple lines, it would much easier to see the actual layout of your data if you put the example in your original post and then made it into a code block, so that the original format is retained, which you can do by enclosing the block of lines within backtick characters. If you click on "help", you will see information on how you can format your posts and comments. You might be able to use substring extraction within a for loop of a batch file, but I'm unsure of the actual layout of your data.
– moonpoint – 2017-05-23T03:20:30.350