Author Topic: text file scanner  (Read 13280 times)

0 Members and 1 Guest are viewing this topic.

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
text file scanner
« on: December 31, 2010, 06:10:46 AM »
+1
I'm not really sure how to go about this.. so I'll just tell you guys what I'm looking for and maybe you guys can point me in the right direction.

a little background history... I work on a CNC machine which is coded by a McMaster Cam design program the file format is .nc which can be read in text file format.  what I'm looking for is a program that reads the whole text file and reports each tool # and the Farthest Z Depth. I'm looking for a text file that I can attach to show you what the file looks like...

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: text file scanner
« Reply #1 on: January 01, 2011, 11:09:06 AM »
+1
There are a ton of file parsing tools out there and reporting tools most are free. Get me a copy of one of th efiles and I can prolly get you a link to one or even help you right one quickly in c or pascal.

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: text file scanner
« Reply #2 on: January 01, 2011, 05:34:04 PM »
+1
thanks a lot.. I'll have to wait till Monday before I can snag a file from work... I've been reading the program we use is way out dated but for small business's it does what we need.  I'm sure its gotta be sometime simple for you guys that write programs all the time...
from what I can remember is you will see the start of a tool would be something like
T1 [Tool 1]
a few lines of code then you will start to see the z values somethine like
Z-1.125
ect ect ect.

sometimes the z will have multiple depths for each tool I would like to find the deepest depth for each Tool Number.
« Last Edit: January 01, 2011, 05:38:43 PM by Khameleon »

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: text file scanner
« Reply #3 on: January 05, 2011, 03:16:45 PM »
+1
here's the type of code that i'm looking to scan...
%
O0000
(PROGRAM NAME - 13430 PUNCH GEO)
(DATE=DD-MM-YY - 05-01-11 TIME=HH:MM - 18:04)
N100G20
N102G0G17G40G49G80G90
( 1/2 CENTERDRILL TOOL - 1 DIA. OFF. - 1 LEN. - 1 DIA. - .5) Beginning of First tool
N104T1M6
N106G0G90G54X-2.5289Y11.8305A0.S2500M3
N108G43H1Z.1M8
N110G99G81Z-.26R.1F40.   Right here is the first Z depth -.26
N112X2.3831
N114X-12.3794Y11.837
N116X-7.4582
N118X7.3056
N120X12.3523Y11.8412
N122Y15.8335
N124X-15.6538Y15.837
N126X-7.1548
N128G80
N130M5
N132G91G28Z0.M9
N134G28X0.Y0.A0.
N136M01 M01 is the End of the first tool
( 1/2 FLAT ENDMILL TOOL - 2 DIA. OFF. - 2 LEN. - 2 DIA. - .5) Switching to 2nd Tool
N138T2M6
N140G0G90G54X-2.1541Y18.587A0.S3056M3
N142G43H2Z-.25 Here we have the z depth again at -.25
N144G1Y18.087F24.45
N146G3X-1.6541Y17.587R.5
N148G1X12.8459
N150G2X13.0959Y17.337R.25
N152G1Y10.587
N154G2X12.8459Y10.337R.25
N156G1X-16.1541
N158G2X-16.4041Y10.587R.25
N160G1Y17.337
N162G2X-16.1541Y17.587R.25
N164G1X-1.6541
N166G3X-1.1541Y18.087R.5
N168G1Y18.587
N170Z.35F6.42
N172M5
N174G91G0G28Z0.
N176G28X0.Y0.A0.
N178M01 M01 again is the end of the tool
( 1/2 FLAT ENDMILL TOOL - 3 DIA. OFF. - 3 LEN. - 3 DIA. - .5) Starting Tool 3
N180T3M6
N182G0G90G54X-2.5289Y11.8305A0.S1833M3
N184G43H3Z.1M8
N186G99G83Z-.25R.1Q.1F14.66 here we have a depth of -.25
N188X2.3831
N190X-12.3794Y11.837
N192X-7.4582
N194X7.3056
N196X12.3523Y11.8412
N198Y15.8335
N200X-15.6538Y15.837
N202X-7.1548
N204G80
N206M5
N208G91G28Z0.M9
N210G28X0.Y0.A0.
N212M02 and now we are at the end of the program noted by M02
%

Sometimes tools are pulled up multiple times at different z depths I don't know if there is a way to scan for T1M6 (T1 = Tool Change to Tool 1) scan the whole section for Z-(what ever this is) until it hits M01 then scan for the next tool T2M6 all the way till the next M01 and so on... then create some sort of Tool List with the farthest Z depth? 


if I confused you please ask me to help me to help you help me :P

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: text file scanner
« Reply #4 on: April 08, 2011, 07:39:42 AM »
+1
you get this all sorted Kham ?
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: text file scanner
« Reply #5 on: April 08, 2011, 04:02:04 PM »
+1
no :(

I would like to we use this code at work, and my moron programer doesn't ever write down tool depths and I have to look through the whole program so I don't smash a tool into my vises...

Scrripty

  • Guest
Re: text file scanner
« Reply #6 on: April 08, 2011, 04:06:34 PM »
+1
no :(

I would like to we use this code at work, and my moron programer doesn't ever write down tool depths and I have to look through the whole program so I don't smash a tool into my vises...

Sounds like your tool programmer needs to be readjusted... :)

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: text file scanner
« Reply #7 on: April 09, 2011, 08:06:54 PM »
+1
Yea, set the x/y coordinates for a stick equal to the x/y coordinate of his @$$, then set the z axis coordinate to -10....

Anyways...you might be able to use Notepad++ to find each of those lines (I believe it has some decent macro functionality). I could also whip up a java program that would look for specific strings, but we'd need to clarify a few things (will a line with a Z in it always be a z-coordinate? does every new tool start with an open parentheses and is that the only thing that does?). It's not too hard for me to whip some things like that up, so let me know!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: text file scanner
« Reply #8 on: April 10, 2011, 04:15:00 AM »
+1
the Z will always be a Negative we never change the Z Starting point.. the only other time z won't be a negative is it will be 0. I can get a basic program file so you can see in multiple tool changes so you can see what it looks like in the program. but the example I put up  a above is a basic program much doesn't change.

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: text file scanner
« Reply #9 on: April 10, 2011, 08:38:07 AM »
+1
if you can post up a legit one, I'll whip up a regex-based Java program that should do exactly what you want!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: text file scanner
« Reply #10 on: April 10, 2011, 09:21:55 AM »
+1
I'll get a file on monday and post it up.

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: text file scanner
« Reply #11 on: April 13, 2011, 12:11:35 PM »
+1
Here's that File you Requested.. please let me know if there is any other information you need...
you can open the file in Notepad to read the file.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
CNC File.rar

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: text file scanner
« Reply #12 on: April 13, 2011, 03:04:21 PM »
+1
Does your computer that you will be running this program on have Java installed on it? Because that's more than likely what I'll use to write it, and I want you to be able to run it! If not, let me know how you would ideally like it to work!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline KhameleonTopic starter

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: text file scanner
« Reply #13 on: April 13, 2011, 04:34:21 PM »
+1
honestly I doubt it.. its a real basic computer with windows xp installed. the computer is dedicated to send the programs out to the CNC machines.. no internet either ;(

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: text file scanner
« Reply #14 on: April 13, 2011, 04:44:45 PM »
+1
Hmm, you really know how to shoot down people's hopes and dreams!  ;)

(I was honestly thinking of setting up a website where you could load the .NC files and have it parse them since you probably didn't have Java installed, but since you don't have internet access, that makes it a little trickier!)

I'll see what I can think up!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Tags: