Subversion Repositories svn1-original

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 31
Line 324... Line 324...
324
    **  Read in lines one by one
324
    **  Read in lines one by one
325
    */
325
    */
326
    while( fgets( line, sizeof(line) - 10 , ufile ) )
326
    while( fgets( line, sizeof(line) - 10 , ufile ) )
327
    {
327
    {
328
        linep = line;
328
        linep = line;
-
 
329
        int has_data = 0;
329
        /*
330
        /*
330
        **  Skip blank lines
331
        **  Skip blank lines
331
        **  Skip leading white space
332
        **  Skip leading white space
332
        */
333
        */
-
 
334
        for ( linep = line; *linep; linep++ )
-
 
335
        {
-
 
336
            if ( *linep == (char)0xA0 || *linep == '"' || *linep == ',' || *linep == '\n' ||*linep == '\r')
-
 
337
            {
-
 
338
                continue;
-
 
339
            }
-
 
340
            has_data = 1;
-
 
341
        }
-
 
342
        if ( !has_data )
-
 
343
            continue;
-
 
344
        
333
        for ( linep = line; isspace( *linep ); linep++ )
345
        for ( linep = line; isspace( *linep ); linep++ )
334
        {
346
        {
335
        }
347
        }
336
        if ( ! *linep )
348
        if ( ! *linep )
337
            continue;
349
            continue;
Line 363... Line 375...
363
            **      - Member names
375
            **      - Member names
364
            */
376
            */
365
            if ( t_parse_text( &linep, line_text ) )
377
            if ( t_parse_text( &linep, line_text ) )
366
            {
378
            {
367
                strncpy (team_buf.name,line_text,MAX_TM_NAME);
379
                strncpy (team_buf.name,line_text,MAX_TM_NAME);
-
 
380
                if ( ! *line_text )
-
 
381
                {
-
 
382
                    printf( "Team: %d - No Team Name:%50.50s...\n", team, line );
-
 
383
                }
368
            }
384
            }
369
 
385
 
370
            if ( t_parse_text( &linep, line_text ) )
386
            if ( t_parse_text( &linep, line_text )  && *line_text)
371
            {
387
            {
372
                int cat_found = 0;
388
                int cat_found = 0;
373
                team_buf.class = lookup_class( line_text, NULL );
389
                team_buf.class = lookup_class( line_text, NULL );
374
                if ( team_buf.class > 0)
390
                if ( team_buf.class > 0)
375
                {
391
                {
Line 383... Line 399...
383
 
399
 
384
                    if ( team_buf.class < MAX_CLASS )
400
                    if ( team_buf.class < MAX_CLASS )
385
                        class_count[team_buf.class]++;
401
                        class_count[team_buf.class]++;
386
                }
402
                }
387
 
403
 
388
                if ( !cat_found && *line_text )
404
                if ( !cat_found )
389
                {
405
                {
390
                    printf( "Team: %d - Invalid category:%s\n", team,line_text );
406
                    printf( "Team: %d - Invalid category:%s\n", team,line_text );
391
                    error++;
407
                    error++;
392
                }
408
                }
393
            }
409
            }
-
 
410
            else
-
 
411
            {
-
 
412
                printf( "Team: %d - No category:%50.50s...\n", team, line );
-
 
413
                error++;
-
 
414
            }
394
 
415
 
395
            for( i = 0; i < MAX_MEMB; i++ )
416
            for( i = 0; i < MAX_MEMB; i++ )
396
            {
417
            {
397
                if ( t_parse_text( &linep, line_text ) )
418
                if ( t_parse_text( &linep, line_text ) )
398
                {
419
                {
Line 401... Line 422...
401
            }
422
            }
402
 
423
 
403
            put_team_record( team, &team_buf );
424
            put_team_record( team, &team_buf );
404
        }
425
        }
405
 
426
 
406
 
427
/*
407
        /*
-
 
408
        **  printf( ">>>:%s\n", line );
428
**       printf( ">>>:%s\n", line );
409
        **  if ( 'q' == getinp() ) break;
429
**       if ( 'q' == getinp() ) break;
410
        */
430
*/       
411
 
431
       
412
    }
432
    }
413
 
433
 
414
    /*
434
    /*
415
    **  Display a few upload stats
435
    **  Display a few upload stats
416
    */
436
    */
Line 522... Line 542...
522
        */
542
        */
523
        if ( uch == '\n' || uch == '\r' || uch == '\0' )
543
        if ( uch == '\n' || uch == '\r' || uch == '\0' )
524
            break;
544
            break;
525
 
545
 
526
        (*linep)++;
546
        (*linep)++;
-
 
547
 
-
 
548
        /*
-
 
549
        ** Ugly character from MS CSV files
-
 
550
        */
-
 
551
        if ( uch == (char) 0xA0 )
-
 
552
        {
-
 
553
            continue;
-
 
554
        }
-
 
555
        
527
        if ( !quoted && uch == ',' )
556
        if ( !quoted && uch == ',' )
528
        {
557
        {
529
            break;
558
            break;
530
        }
559
        }
531
 
560