How to real-time display a number from a running log file or terminal [on hold]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
0
down vote

favorite












I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.



The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?



Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30



What I would like to catch is the values behind Z/z positive and negatine







share|improve this question













put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm♦ Aug 4 at 0:41


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
    – Jesse_b
    Aug 3 at 21:47











  • The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
    – Gero
    Aug 3 at 21:51










  • You can probably do either but in order for us to help you need to post some sample output.
    – Jesse_b
    Aug 3 at 21:51










  • From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
    – Gero
    Aug 3 at 21:53
















up vote
0
down vote

favorite












I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.



The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?



Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30



What I would like to catch is the values behind Z/z positive and negatine







share|improve this question













put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm♦ Aug 4 at 0:41


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
    – Jesse_b
    Aug 3 at 21:47











  • The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
    – Gero
    Aug 3 at 21:51










  • You can probably do either but in order for us to help you need to post some sample output.
    – Jesse_b
    Aug 3 at 21:51










  • From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
    – Gero
    Aug 3 at 21:53












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.



The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?



Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30



What I would like to catch is the values behind Z/z positive and negatine







share|improve this question













I have a CNC and the software runs from a terminal. I would like to catch the current Z axis depth in real-time to display it.
The information I need is shown in the terminal as well as in the log file during the run (G1 Z-0.05) however this might be in the middle of the line with other information. Is there a way to catch the latest Z depth? I think I can manage the display part, so I'm interested in how I can catch the changing Z to always have the current value.
Thanks in advance.



The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?



Sample output From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30



What I would like to catch is the values behind Z/z positive and negatine









share|improve this question












share|improve this question




share|improve this question








edited Aug 3 at 21:58
























asked Aug 3 at 21:46









Gero

61




61




put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm♦ Aug 4 at 0:41


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as too broad by DopeGhoti, schily, Rui F Ribeiro, slm♦ Aug 4 at 0:41


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
    – Jesse_b
    Aug 3 at 21:47











  • The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
    – Gero
    Aug 3 at 21:51










  • You can probably do either but in order for us to help you need to post some sample output.
    – Jesse_b
    Aug 3 at 21:51










  • From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
    – Gero
    Aug 3 at 21:53
















  • Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
    – Jesse_b
    Aug 3 at 21:47











  • The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
    – Gero
    Aug 3 at 21:51










  • You can probably do either but in order for us to help you need to post some sample output.
    – Jesse_b
    Aug 3 at 21:51










  • From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
    – Gero
    Aug 3 at 21:53















Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
– Jesse_b
Aug 3 at 21:47





Please post some sample output and specify the part you want to capture. Do you run a command to start your CNC?
– Jesse_b
Aug 3 at 21:47













The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
– Gero
Aug 3 at 21:51




The software is started with python main.py. In the GUI i run the cut. The commands sent to an arduino are visible in the terminal and also written to a log.txt. Can I intercept the terminal or is it easier to tail the log?
– Gero
Aug 3 at 21:51












You can probably do either but in order for us to help you need to post some sample output.
– Jesse_b
Aug 3 at 21:51




You can probably do either but in order for us to help you need to post some sample output.
– Jesse_b
Aug 3 at 21:51












From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
– Gero
Aug 3 at 21:53




From the terminal: "Sending: G0 Z0.5" From the logfile: Sent: G1 Z-0.05 F30
– Gero
Aug 3 at 21:53










1 Answer
1






active

oldest

votes

















up vote
2
down vote













Given example input of:



Sent: G1 Z-0.05 F30


This should capture the information you desire:



grep -o 'Z[^ ]*' inputfile
Z-0.05


Or, to capture in real-time:



tail -f inputfile | grep -o 'Z[^ ]*'





share|improve this answer























  • grep --line-buffered for faster response.
    – Jasen
    2 days ago

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













Given example input of:



Sent: G1 Z-0.05 F30


This should capture the information you desire:



grep -o 'Z[^ ]*' inputfile
Z-0.05


Or, to capture in real-time:



tail -f inputfile | grep -o 'Z[^ ]*'





share|improve this answer























  • grep --line-buffered for faster response.
    – Jasen
    2 days ago














up vote
2
down vote













Given example input of:



Sent: G1 Z-0.05 F30


This should capture the information you desire:



grep -o 'Z[^ ]*' inputfile
Z-0.05


Or, to capture in real-time:



tail -f inputfile | grep -o 'Z[^ ]*'





share|improve this answer























  • grep --line-buffered for faster response.
    – Jasen
    2 days ago












up vote
2
down vote










up vote
2
down vote









Given example input of:



Sent: G1 Z-0.05 F30


This should capture the information you desire:



grep -o 'Z[^ ]*' inputfile
Z-0.05


Or, to capture in real-time:



tail -f inputfile | grep -o 'Z[^ ]*'





share|improve this answer















Given example input of:



Sent: G1 Z-0.05 F30


This should capture the information you desire:



grep -o 'Z[^ ]*' inputfile
Z-0.05


Or, to capture in real-time:



tail -f inputfile | grep -o 'Z[^ ]*'






share|improve this answer















share|improve this answer



share|improve this answer








edited Aug 3 at 22:14


























answered Aug 3 at 22:04









DopeGhoti

39.5k54679




39.5k54679











  • grep --line-buffered for faster response.
    – Jasen
    2 days ago
















  • grep --line-buffered for faster response.
    – Jasen
    2 days ago















grep --line-buffered for faster response.
– Jasen
2 days ago




grep --line-buffered for faster response.
– Jasen
2 days ago


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay