![]() |
|
|
#1 |
|
Sep 2003
5·11·47 Posts |
The files status.txt and cleared.txt are available at:
http://www.mersenne.org/primenet/status.txt http://www.mersenne.org/primenet/cleared.txt These files are in a fixed-width format that is not necessarily convenient for data manipulation, and include a lot of non-data lines (header, footer, column headings). The following converts the files first into the comma-separated files: status_comma.txt cleared_comma.txt Then the files are further split into: status_f.txt status_l.txt cleared_f.txt cleared_l.txt (with _f for factoring and and _l for LL assignments), at which point status_comma.txt and cleared_comma.txt can be discarded. Code:
perl statusizer.pl status.txt > status_comma.txt
perl -n -e 'print if /^[^,]*,.F,/' status_comma.txt > status_f.txt
perl -n -e 'print unless /^[^,]*,.F,/' status_comma.txt > status_l.txt
perl clearedizer.pl cleared.txt > cleared_comma.txt
perl -n -e 'print if /^([^,]*,){2}.F,/' cleared_comma.txt > cleared_f.txt
perl -n -e 'print unless /^([^,]*,){2}.F,/' cleared_comma.txt > cleared_l.txt
The scripts statusizer.pl and clearedizer.pl are attached. |
|
|
|
|
|
#2 |
|
Sep 2002
66210 Posts |
If you are using windows what brand and version of perl do you use ( or if not using windows what do you recommend ) ?
Thanks for the scripts. |
|
|
|
|
|
#3 | |
|
Sep 2003
5·11·47 Posts |
Quote:
For Windows I think you can get ActiveState's version of Perl, but I've never personally used it. |
|
|
|
|
|
|
#4 |
|
"Mike"
Aug 2002
100000001000002 Posts |
If you are running Windows, and you don't have Cygwin installed, then shame on you...
![]() http://www.cygwin.com/ |
|
|
|
|
|
#5 | |
|
Sep 2003
5·11·47 Posts |
Quote:
All of my scripts for datamining the data files use standard Linux utilities like sort, uniq, cut, comm, join, paste and also sed, grep, perl. With Cygwin these become available on Windows too. |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scripts thread | bsquared | YAFU | 4 | 2012-10-21 19:45 |
| the scripts thread | Mini-Geek | Conjectures 'R Us | 52 | 2012-05-29 21:43 |
| Perl scripts for result file conversion | nuggetprime | No Prime Left Behind | 5 | 2009-01-02 19:44 |
| convert 3d into 2d | nuggetprime | Programming | 6 | 2007-09-22 08:35 |
| Linux! Convert me! | OmbooHankvald | Linux | 8 | 2005-08-13 23:50 |