| Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3). |
Navigation
| Topics | Register • News • History • How to • Sequences statistics • Template prototypes |
Splitting a sieve file
Description
Splitting a sieve file in PRP-LLR format into a number of separate files using awk.
Needed software
- ASCII editor
awk.exe(included by default on Linux)
Example
Split the sieve file t16_b999.prp into 4 separate files.
Preparation WIN
- Copy
gawk.exein a folder - Create a file named
split.awkwith this code:
BEGIN {getline line; i=1}
{
if (head[i] == 0)
{
print line >>i".txt"
head[i]=1
}
print $0 >>i".txt"
i++
if (i==files+1) i=1
}
- Copy the sieve file in this folder (for example
t16_b999.prp). - Call
gawk -f split.awk files=4 t16_b999.prp.
Results:
- Creates 4 files
1.txtto4.txtwith equally split candidates sorted by n.
Preparation LINUX
awkis probably already present on your computer.- Create a file named
split.awkwith the same code as above. - Copy the sieve file in this folder (for example
t16_b999.prp). - Call
awk -f split.awk files=4 t16_b999.prp.
Results:
- Creates 4 files
1.txtto4.txtwith equally split candidates sorted by n.