23 lines
744 B
Bash
Executable File
23 lines
744 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Paste results for each variable P_i into single output
|
|
|
|
## [ https://stackoverflow.com/questions/20163225/paste-files-from-list-of-paths-into-single-output-file ]
|
|
#
|
|
|
|
n="$1" # number of measures P_i, input
|
|
MEASUREBASE="P_" # measure P_ with index i
|
|
CSVFILE="$2" # results file, input
|
|
|
|
for i in $(seq 1 $n); do
|
|
LIST="${LIST} ${MEASUREBASE}${i} ${CSVFILE}"
|
|
done
|
|
|
|
touch buffer.txt;
|
|
echo "${LIST}" | xargs -n2 bash -c 'paste buffer.txt <(./bin/data.awk "$@") > output.txt; mv output.txt buffer.txt' FILLER; # Name,Start Time,Mean,Confidence Interval,Name,Start Time,Mean,Confidence Interval,...
|
|
mv buffer.txt output.txt
|
|
rm -f buffer.txt
|
|
cat output.txt
|
|
rm -f output.txt
|
|
|