4 ms·
Alternative interface: CSV, no Javascript required cat > 090.l <<eof int fileno (FILE *); #define jmp (yy_start) = 1 + 2 * int x,c,f,u;
by 1vuio0pswjnm7 3y ago
Alternative interface: CSV, no Javascript required
cat > 090.l <<eof
int fileno (FILE *);
#define jmp (yy_start) = 1 + 2 *
int x,c,f,u;
%option nounput noinput noyywrap
%%
\} printf("%d\n",f);f=0;
\"[^\"]+\":[ ]+\"[^\"]+|\"[^\"]+\":\"[^\"]+ {
f++;
for(x=0;x<yyleng;x++)
{
if(yytext[x]==34)c++;
if(yytext[x]==92)u++;
if(yytext[x]==34)if(u)
putc(yytext[x],yyout);
if(u)u--;
if(yytext[x]!=34)if(c==3)
putc(yytext[x],yyout);
}
putc(44,yyout);
c=0;
}
\"[^\"]+\":[ ]+[0-9]+|\"[^\"]+\":[0-9]+ {
f++;
for(x=0;x<yyleng;x++)
if(yytext[x]>47)if(yytext[x]<58)
putc(yytext[x],yyout);
putc(44,yyout);
}
.|\n
%%
int main(){
yylex();
exit(0);
}
eof
flex -8Cem 090.l
cc -O3 -std=c89 -W -Wall -pedantic -pipe lex.yy.c -static -o yy090
strip -s yy090
x=https://releng.netbsd.org/bulktracker/json/allbuilds/;
ftp -4o'|(printf BuildID,PlatformD,BuildTs,Branch,Compiler,
printf BuildUser,ReportUrl,NumOk,NumPrefailed,NumFailed,
printf NumIndirectFailed,NumIndirectPrefailed,NumCols'\n';
yy090)' $x