mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > PrimeNet

Closed Thread
 
Thread Tools
Old 2004-03-19, 14:58   #1
dave_0273
 
dave_0273's Avatar
 
Oct 2003
Australia, Brisbane

2×5×47 Posts
Default Converting hrf3.txt file

What I want to do is convert hrf3.txt into a txt file that just has the exponents. Does anyone know how to do this??

I am running Windows2000 if it matters.
dave_0273 is offline  
Old 2004-03-19, 15:33   #2
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

26×33×5 Posts
Default

[pre]cut -d ',' -f 1 HRF3.TXT[/pre]

Use Cygwin or Linux...
Xyzzy is offline  
Old 2004-03-19, 18:01   #3
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

2×3×11×167 Posts
Default

A short Basic program could do it. (I don't know if 2000 has any legacy Basic include deep in the files.)
Uncwilly is offline  
Old 2004-03-19, 18:16   #4
nfortino
 
nfortino's Avatar
 
Nov 2003

A516 Posts
Default

Quote:
Originally Posted by Xyzzy
[pre]cut -d ',' -f 1 HRF3.TXT[/pre]

Use Cygwin or Linux...
If you want each exponent to appear only once, use the "uniq" command yeilding [pre] cut -d, -f 1 |uniq HRF3.TXT[/pre]
nfortino is offline  
Old 2004-03-19, 18:34   #5
dave_0273
 
dave_0273's Avatar
 
Oct 2003
Australia, Brisbane

2×5×47 Posts
Default

Thanks for you replies. I can now get the list of exponents coming up in the command window, but how do I make it put all that data in a txt file. Or alternatively, I don't even mind if it edits the original file.
dave_0273 is offline  
Old 2004-03-19, 20:04   #6
Fusion_power
 
Fusion_power's Avatar
 
Aug 2003
Snicker, AL

3C016 Posts
Default

Dave,

Its not simple to do this without a decent tool. Here is a way that will work but is cumbersome in the extreme. I am presuming that you have both Microsoft Word and Excel.

1. open the txt file with Word.
2. cut and paste about 30,000 lines of data from the txt file into an excel spreadsheet. Cut and paste another 30,000 lines of data from the txt doc into the excel sheet beneath the other data.
3. Select column A and use Data, text to columns, set the delimiter to comma. This will separate the exponents into the "A" column.
4. Copy and paste the exponents from the "A" column into another Word document.
5. Repeat the process for the rest of the original txt file.

As I said, cumbersome at best but can be done in about 5 minutes.

Fusion
Fusion_power is offline  
Old 2004-03-19, 21:05   #7
gowen72
 
Aug 2002

72 Posts
Default

If you've gone the Cygwin route:

[pre]cut -d, -f 1 |uniq HRF3.TXT > exponents.txt[/pre]

Last fiddled with by gowen72 on 2004-03-19 at 21:06
gowen72 is offline  
Old 2004-03-19, 21:24   #8
dsouza123
 
dsouza123's Avatar
 
Sep 2002

29616 Posts
Default

I have attached a very small delphi 4 program 17kb (with source) that creates a text file listing unique exponents from hrf3.txt

Called hrf3exp.exe just place it in the directory that has the hrf3.txt file
it will create resulting unique exponent only text file hrf3exp.txt in 1 second,
( on a Athlon 1200 ).

Both program and source are in the attachment hrf3exp.zip
Attached Files
File Type: zip Hrf3Exp.zip (9.8 KB, 217 views)
dsouza123 is offline  
Old 2004-03-19, 23:46   #9
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

170148 Posts
Default

Quote:
Originally Posted by Fusion_power
Its not simple to do this without a decent tool. Here is a way that will work but is cumbersome in the extreme. I am presuming that you have both Microsoft Word
Ditto about the decent tool. (I use and recommend the TextPad editor from http://textpad.com/.)

But even Microsoft Word (setting aside argument about whether it is a decent tool) can accomplish what Dave wants in a much simpler way. (And Excel is not needed.)

1. Open the txt file with Word.
2. While holding down the Alt key, use the cursor to select the block of text to be deleted. Start with the comma following the 7-digit exponent on the first line, then select down and to the right to include the entire post-exponent portion of each line through the last line with a 7-digit exponent.
3. Press Delete to delete the selected text.
4. Repeat steps 2 and 3 for the lines with 8-digit exponents. (This will require some patience and diligence in holding down both the Alt key and mouse button while maneuvering the cursor to cause Word to page down to the end of the file.)

This may still take 5 minutes if block deletion is slow in your version of MS Word, but it's fairly simple, especially after hrf3.txt contains only 8-digit exponents in the not-too-distant future. :)


If you're using some other editor, look for something like "Block Select Mode".

Last fiddled with by cheesehead on 2004-03-19 at 23:58
cheesehead is offline  
Old 2004-03-20, 02:01   #10
markr
 
markr's Avatar
 
"Mark"
Feb 2003
Sydney

3·191 Posts
Default

As cheesehead says, block-select is the feature to look for. If Word is your text editor of choice (or just available), there are a couple other variations on block-selecting text which may help, depending on the situation. Start with the cursor where you want one corner to be. One way is then alt-shift-click at the other corner, remembering to use the scroll bar not the keyboard to get there. The other way is to press control-shift-F8 to invoke block selecting mode, then either use keyboard to move the other corner or scroll & click where you want it. With these ways there's no need to hold keys while navigating. To pick up the exponents from hrf3, it might be quicker to delete the unwanted stuff than to copy the wanted part.
markr is offline  
Old 2004-03-20, 02:22   #11
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

2B0E16 Posts
Default

UED has block, range, and line choices for cut/paste features and allows 9 documents to be open at the same time. Saddly it is an old DOS program and has memory limits.
Uncwilly is offline  
Closed Thread

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting from v4 to v5 devjonfos Linux 4 2009-01-29 10:15
What happened to hrf3 in last update? patrik Data 3 2007-02-08 11:10
hrf3.zip and lucas_v.zip of Dec 12 corrupt? patrik Data 2 2005-12-19 04:36
HRF3.TXT now has computer-id and error code GP2 Data 2 2003-10-09 06:46
Duplicate lines in HRF3.TXT GP2 Data 2 2003-10-04 01:27

All times are UTC. The time now is 23:08.


Fri Jun 2 23:08:47 UTC 2023 up 288 days, 20:37, 0 users, load averages: 1.19, 1.18, 1.10

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, 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.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔