Ignore:
Timestamp:
2020-10-04T23:33:54+13:00 (4 years ago)
Author:
davidb
Message:

Fix for 'tail' issue; more careful control of output name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/mars/collect/deam/03-COLLATE-ALL-CSV-FEATURE-FILES.sh

    r34433 r34437  
    44for_header_file=import/3.csv
    55
     6output_csv_file=etc/deam-essentia-features-collated.csv
     7
    68echo "******"
    7 echo "* Outputing CSV headers based on 1st line of $for_header_file to ESSENTIA-FEATURES-COLLATED.csv"
     9echo "* Outputing CSV headers based on 1st line of $for_header_file to $output_csv_file"
    810
    9 head -n 1 $for_header_file > ESSENTIA-FEATURES-COLLATED.csv
     11head -n 1 $for_header_file > $output_csv_file
    1012echo "****"
    1113
    12 for f in import/*.csv ; do
     14for f in import/[0-9]*.csv ; do
    1315    echo "* Appending CSV features for $f"
    14     tail -n 1 $f >> ESSENTIA-FEATURES-COLLATED.csv
     16    # Found 'tail -n 1 $f' directly on file for some reason return 2 lines (confirmed with 'wc')
     17    # However, operating through 'cat' first, things work as expected
     18    cat $f | tail -n 1 >> $output_csv_file
    1519done
    1620echo "******"
Note: See TracChangeset for help on using the changeset viewer.