Parsing Andrew’s verified-zero data

adrstring=Import["/Users/kevin/Dropbox/Research/Math Projects/ApresTrudgian/adr_zeros_data/all_zeros_L6.txt"]

StringLength[adrstring]
StringCount[adrstring,"\n"]

(*Split each character onto its own line.*)
adrlines=StringSplit[adrstring,"\n"]

Last[adrlines]

(*Move the comment at the end into its own thing, strip out the number*)
(*remove the leading and trailing bracket from the start *)
adrlines2=(Map[StringSplit[#,"\t"]&,adrlines]/.{a_String,b_String}:>{StringDrop[StringDrop[a,1],-2],N[ToExpression[StringSplit[b][[7]]]]});

adrlines2[[973]]

LeadIntoExpression[s_String]:=Module[{pos1,pos2,zeros,data,AndrewNumberToMathematicaNumber},
(*AndrewNumberToMathematicaNumber[ss_String]:=
SetAccuracy[ToExpression[StringReplace[ss,"e"->"*10^"]],11];*)
AndrewNumberToMathematicaNumber[ss_String]:=
ToExpression[StringReplace[ss,"e"->"*10^"]];
pos1=First[First[StringPosition[s,"["]]];
pos2=First[First[StringPosition[s,"]"]]];
zeros=Map[AndrewNumberToMathematicaNumber,StringSplit[StringTake[s,{pos1+1,pos2-1}],","]];
data=Map[ToExpression,StringSplit[StringTake[s,{6,pos1-3}],","]];
Join[Prepend[data,StringPart[s,2]],{zeros}]];

adrlist=adrlines2/.s_String:>LeadIntoExpression[s];

adrlist[[30000]]
adrlist[[9999]]
adrlist[[973]]

<<DirichletCharacters`

mathematicastyle[line_]:=Module[{char,test,type,q,m1,m2,n,a,zeros,maxT},
If[
line[[1,1]]=="C",
	{{type,q,m1,m2,n,a,zeros},maxT}=line,
	{{type,q,m1,n,a,zeros},maxT}=line];
char=DC[q,m1];
test[1]=If[RealCharacterQ[char],type=="R",type=="C"];
test[2]=If[type=="C",ConreyIndex[ConjugateCharacter[char]]==m2,True];
test[3]=If[type=="R",n==2Length[zeros],n==Length[zeros]];
test[4]=a==If[char[-1]==1,0,1];
If[test[1]&&test[2]&&test[3]&&test[4],
Flatten[{q,m1,maxT,zeros}],Print["Problem with line: ",{{type,q,m1,m2,n,a,zeros},maxT}]]]

mathematicastyle[adrlist[[1]]]
mathematicastyle[adrlist[[973]]]

zetadata=Flatten[{1,1,N[2533],Table[N[Im[ZetaZero[k]]],{k,2016}]}];

zd=Prepend[Map[mathematicastyle,adrlist],zetadata];

myfunc[row_]:=
Module[{char,q,index,even,conj,real,math,mh,zeros},
q=row[[1]];
index=row[[2]];
mh=row[[3]];
zeros=Drop[row,3];
char=DC[q,index];
even=EvenQ[char];
conj=ConreyIndex[ConjugateCharacter[char]];
real=RealCharacterQ[char];
math=Last[ConreyIndexToMathematicaIndex[char]];


char-><|"even"->even,"conjugate"->conj,"real"->real,"mathematicaindex"->math,"maxheight"->mh,"zeros"->zeros|>];

Do[
characterdata[q]=Dataset[Association@@Map[myfunc,Select[zd,First[#]==q&]]];
Export[FileNameJoin[{NotebookDirectory[],"CharacterData","dirichlet"<>ToString[q]<>".mx"}],characterdata[q]],
{q,Select[Range[1,100],Mod[#,4]≠2&]}]

Do[
characterdata[q]=Dataset[Association@@Map[myfunc,Select[zd,First[#]==q&]]];
Export[FileNameJoin[{NotebookDirectory[],"CharacterData","dirichlet"<>ToString[q]<>".mx"}],characterdata[q]],
{q,Select[Range[101,500],Mod[#,4]≠2&]}]

Do[
characterdata[q]=Dataset[Association@@Map[myfunc,Select[zd,First[#]==q&]]];
Export[FileNameJoin[{NotebookDirectory[],"CharacterData","dirichlet"<>ToString[q]<>".mx"}],characterdata[q]],
{q,Select[Range[501,800],Mod[#,4]≠2&]}]

Do[
characterdata[q]=Dataset[Association@@Map[myfunc,Select[zd,First[#]==q&]]];
Export[FileNameJoin[{NotebookDirectory[],"CharacterData","dirichlet"<>ToString[q]<>".mx"}],characterdata[q]],
{q,Select[Range[801,900],Mod[#,4]≠2&]}]

Do[
characterdata[q]=Dataset[Association@@Map[myfunc,Select[zd,First[#]==q&]]];
Export[FileNameJoin[{NotebookDirectory[],"CharacterData","dirichlet"<>ToString[q]<>".mx"}],characterdata[q]],
{q,Select[Range[901,934],Mod[#,4]≠2&]}]