mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-29 10:40:22 +00:00
neaten
This commit is contained in:
parent
969d9f09a0
commit
b327c8154e
3 changed files with 13 additions and 3 deletions
|
|
@ -1 +0,0 @@
|
|||
a=wye,b=eks,i=0,x=0.641593543645736508,y=0.262688053894177098
|
||||
10
c/data/nlines/10
Normal file
10
c/data/nlines/10
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
a=wye,b=eks,i=0,x=0.641593543645736508,y=0.262688053894177098
|
||||
a=eks,b=zee,i=1,x=0.827614412562742041,y=0.715431942006308552
|
||||
a=zee,b=zee,i=2,x=0.923068348748175560,y=0.009737410587136359
|
||||
a=zee,b=pan,i=3,x=0.000047786161325772,y=0.803142013402256216
|
||||
a=zee,b=hat,i=4,x=0.676537984365847889,y=0.573903236805416328
|
||||
a=eks,b=pan,i=5,x=0.097245026890768221,y=0.397166953141413148
|
||||
a=zee,b=eks,i=6,x=0.508101613497408899,y=0.663818050950680916
|
||||
a=pan,b=wye,i=7,x=0.833840054382495643,y=0.349794006603674046
|
||||
a=eks,b=wye,i=8,x=0.350414154748625195,y=0.410698860143636768
|
||||
a=wye,b=hat,i=9,x=0.393088969119400222,y=0.646303989759787867
|
||||
|
|
@ -29,7 +29,7 @@ static int do_stream(char* file_name) {
|
|||
perror("fstat");
|
||||
exit(1);
|
||||
}
|
||||
char* sof = mmap(NULL, (size_t)stat.st_size, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
|
||||
char* sof = mmap(NULL, (size_t)stat.st_size, PROT_READ|PROT_WRITE, MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
|
||||
if (sof == MAP_FAILED) {
|
||||
perror("mmap");
|
||||
exit(1);
|
||||
|
|
@ -41,9 +41,10 @@ static int do_stream(char* file_name) {
|
|||
|
||||
while (p < eof) {
|
||||
if (*p == '\n') {
|
||||
p++;
|
||||
*p = 0;
|
||||
eol = p;
|
||||
emit(sol, eol, output_stream);
|
||||
p++;
|
||||
sol = p;
|
||||
} else {
|
||||
p++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue