source: main/trunk/model-sites-dev/mars/collect/deam/03-COLLATE-ALL-CSV-FEATURE-FILES.sh@ 34437

Last change on this file since 34437 was 34437, checked in by davidb, 4 years ago

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

  • Property svn:executable set to *
File size: 569 bytes
Line 
1#!/bin/bash
2
3
4for_header_file=import/3.csv
5
6output_csv_file=etc/deam-essentia-features-collated.csv
7
8echo "******"
9echo "* Outputing CSV headers based on 1st line of $for_header_file to $output_csv_file"
10
11head -n 1 $for_header_file > $output_csv_file
12echo "****"
13
14for f in import/[0-9]*.csv ; do
15 echo "* Appending CSV features for $f"
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
19done
20echo "******"
21
Note: See TracBrowser for help on using the repository browser.