![]() |
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. |
[pre]cut -d ',' -f 1 HRF3.TXT[/pre]
Use Cygwin or Linux... |
A short Basic program could do it. (I don't know if 2000 has any legacy Basic include deep in the files.)
|
[QUOTE=Xyzzy][pre]cut -d ',' -f 1 HRF3.TXT[/pre]
Use Cygwin or Linux...[/QUOTE] If you want each exponent to appear only once, use the "uniq" command yeilding [pre] cut -d, -f 1 |uniq HRF3.TXT[/pre] |
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,
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 |
If you've gone the Cygwin route:
[pre]cut -d, -f 1 |uniq HRF3.TXT > exponents.txt[/pre] |
1 Attachment(s)
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 |
[QUOTE=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[/QUOTE]
Ditto about the decent tool. (I use and recommend the TextPad editor from [url]http://textpad.com/[/url].) 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". |
As cheesehead says, block-select is the feature to look for. If Word is your text editor of choice :grin: (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.
|
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.
|
| All times are UTC. The time now is 05:48. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.