https://github.com/ab4377/dream-project
Raw File
Tip revision: 8e64d9628355fde264b6481f9955478fed995fe5 authored by Avinash Bukkittu on 04 October 2017, 22:20:26 UTC
Merge branch 'master' of https://github.com/ab4377/dream-project
Tip revision: 8e64d96
GetData2.sh
base_path="/ifs/home/c2b2/ip_lab/shares/DATA/fwd_bwd_data/converted_fb_accel_data/"
dest_file="/ifs/home/c2b2/ip_lab/shares/DATA/dataset/$1"

if [ ! -f $1 ]; then
	echo  "$1 does not exist"
	exit
fi
touch $dest_file
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
	src_location="$base_path$line"
	echo "Copying files for $line"
	echo "SOURCE LOCATION - $src_location"
	
	#rename the files
	if [ -f "$src_location/outbound.csv" ]; then
		tail -n +2 "$src_location/outbound.csv" >> "$dest_file"
	fi

	if [ -f "$src_location/return.csv" ]; then
		tail -n +2 "$src_location/return.csv" >> "$dest_file"
	fi
done < "$1"
back to top