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

From Prime-Wiki
Jump to: navigation, search

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.exe in a folder
  • Create a file named split.awk with 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.txt to 4.txt with equally split candidates sorted by n.

Preparation LINUX

  • awk is probably already present on your computer.
  • Create a file named split.awk with 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.txt to 4.txt with equally split candidates sorted by n.