Changeset 30675
- Timestamp:
- Mar 21, 2008, 4:31:16 AM (16 years ago)
- Location:
- grass/trunk/raster/r.in.xyz
- Files:
-
- 2 edited
-
local_proto.h (modified) (1 diff)
-
main.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/raster/r.in.xyz/local_proto.h
r25198 r30675 39 39 40 40 /* main.c */ 41 int scan_bounds(FILE*, int, int, int, char*, int );41 int scan_bounds(FILE*, int, int, int, char*, int, int); 42 42 43 43 /* support.c */ -
grass/trunk/raster/r.in.xyz/main.c
r29905 r30675 143 143 struct Option *method_opt, *xcol_opt, *ycol_opt, *zcol_opt, *zrange_opt; 144 144 struct Option *trim_opt, *pth_opt; 145 struct Flag *scan_flag, *shell_style ;145 struct Flag *scan_flag, *shell_style, *skipline; 146 146 147 147 … … 245 245 shell_style->description = _("In scan mode, print using shell script style"); 246 246 247 skipline = G_define_flag(); 248 skipline->key = 'i'; 249 skipline->description = _("Ignore broken lines"); 247 250 248 251 if (G_parser(argc,argv)) … … 451 454 G_warning(_("zrange will not be taken into account during scan")); 452 455 453 scan_bounds(in_fp, xcol, ycol, zcol, fs, shell_style->answer );456 scan_bounds(in_fp, xcol, ycol, zcol, fs, shell_style->answer, skipline->answer); 454 457 455 458 if(!from_stdin) … … 560 563 ntokens = G_number_of_tokens ( tokens ); 561 564 562 if((ntokens < 3) || (max_col > ntokens) ) 563 G_fatal_error(_("Not enough data columns. " 564 "Incorrect delimiter or column number? " 565 "Found the following character(s) in row %d:\n[%s]"), line, buff); 565 if((ntokens < 3) || (max_col > ntokens) ) { 566 if (skipline->answer) { 567 G_warning(_("Not enough data columns. " 568 "Incorrect delimiter or column number? " 569 "Found the following character(s) in row %d:\n[%s]"), line, buff); 570 G_warning(_("Line ignored as requested")); 571 continue; /* line is garbage */ 572 } else { 573 G_fatal_error(_("Not enough data columns. " 574 "Incorrect delimiter or column number? " 575 "Found the following character(s) in row %d:\n[%s]"), line, buff); 576 } 577 } 566 578 567 579 /* too slow? … … 1000 1012 1001 1013 1002 int scan_bounds(FILE* fp, int xcol, int ycol, int zcol, char *fs, int shell_style )1014 int scan_bounds(FILE* fp, int xcol, int ycol, int zcol, char *fs, int shell_style, int skipline) 1003 1015 { 1004 1016 int line, first, max_col; … … 1028 1040 ntokens = G_number_of_tokens ( tokens ); 1029 1041 1030 if((ntokens < 3) || (max_col > ntokens) ) 1031 G_fatal_error(_("Not enough data columns. " 1032 "Incorrect delimiter or column number?\n[%s]"), buff); 1042 if((ntokens < 3) || (max_col > ntokens) ) { 1043 if (skipline) { 1044 G_warning(_("Not enough data columns. " 1045 "Incorrect delimiter or column number? " 1046 "Found the following character(s) in row %d:\n[%s]"), line, buff); 1047 G_warning(_("Line ignored as requested")); 1048 continue; /* line is garbage */ 1049 } else { 1050 G_fatal_error(_("Not enough data columns. " 1051 "Incorrect delimiter or column number? " 1052 "Found the following character(s) in row %d:\n[%s]"), line, buff); 1053 } 1054 } 1033 1055 1034 1056 /* too slow?
Note:
See TracChangeset
for help on using the changeset viewer.
