mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2015-05-15, 15:18   #12
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

135210 Posts
Default

Standard output looks like
92*10^542048-1 is not prime. RES64: DEADBEEFDEADBEEF. OLD64: EE08834052D0214E Time : 990.560 sec.

What I need to do when this output is copied to results.txt is automatically crop to
( OLD64: EE08834052D0214E Time : 990.560 sec. is automatically removed)

92*10^542048-1 is not prime. RES64: DEADBEEFDEADBEEF.

Last fiddled with by CRGreathouse on 2015-05-15 at 16:03 Reason: Residue bowdlerization
pepi37 is offline   Reply With Quote
Old 2015-05-22, 01:32   #13
alexvong1995
 
Dec 2014

37 Posts
Default

Quote:
Originally Posted by pepi37 View Post
Standard output looks like
92*10^542048-1 is not prime. RES64: DEADBEEFDEADBEEF. OLD64: EE08834052D0214E Time : 990.560 sec.

What I need to do when this output is copied to results.txt is automatically crop to
( OLD64: EE08834052D0214E Time : 990.560 sec. is automatically removed)

92*10^542048-1 is not prime. RES64: DEADBEEFDEADBEEF.
This command should match the pattern you want.
Code:
echo '92*10^542048-1 is not prime. RES64: DEADBEEFDEADBEEF. OLD64: EE08834052D0214E Time : 990.560 sec.' | grep -o -e '^[^.]* is not prime. RES64: [[:upper:]]\{16\}.'
If you want to know more about regex in grep, the GNU grep manual is great. If you need more text processing power, then perl is your Swiss-army chainsaw.
alexvong1995 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sieving with powers of small primes in the Small Prime variation of the Quadratic Sieve mickfrancis Factoring 2 2016-05-06 08:13
Small primes kar_bon Riesel Prime Data Collecting (k*2^n-1) 3 2013-05-11 04:56
Small Primes Housemouse Math 2 2008-06-04 05:23
Small Primes for Octoproths <= 155 ValerieVonck Octoproth Search 100 2007-02-16 23:43
Generating Small Primes wblipp Software 2 2005-01-05 13:29

All times are UTC. The time now is 13:33.

Thu Nov 26 13:33:56 UTC 2020 up 77 days, 10:44, 3 users, load averages: 1.75, 1.64, 1.59

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.