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 |
|
---|
4 | for_header_file=import/3.csv
|
---|
5 |
|
---|
6 | output_csv_file=etc/deam-essentia-features-collated.csv
|
---|
7 |
|
---|
8 | echo "******"
|
---|
9 | echo "* Outputing CSV headers based on 1st line of $for_header_file to $output_csv_file"
|
---|
10 |
|
---|
11 | head -n 1 $for_header_file > $output_csv_file
|
---|
12 | echo "****"
|
---|
13 |
|
---|
14 | for 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
|
---|
19 | done
|
---|
20 | echo "******"
|
---|
21 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.