-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmove_csv.sh
58 lines (52 loc) · 2.21 KB
/
move_csv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
echo -e "\033[0;36mBEGINNING FILE CLEAN\033[0m"
echo -e "\033[0;33m----------------------------------------------------------------------------------------------------------------\033[0m"
sleep 2
while true
do
if [ -d ./csv ]
then
rm ./csv/*
echo -e "\033[0;35mINITIALIZING FILE SEARCH\033[0m"
sleep 1.5
echo -e "\033[0;33mCSV FILE SEARCH\033[0m"
echo -e "\033[0;33m----------------------------------------------------------------------------------------------------------------\033[0m"
if [ /*.csv ]
then
echo -e "CSV File Detected:\n"
sleep 2
ls ./*.csv
sleep 3
echo -e "Moving CSV Files to CSV Directory..\n"
mv ./*.csv ./csv
echo -e "Files Successfully moved!\n"
echo -e "\033[0;33m----------------------------------------------------------------------------------------------------------------\033[0m"
else
echo -e "No CSV Files Were Found!\n"
echo -e "\033[0;33m----------------------------------------------------------------------------------------------------------------\033[0m"
fi
break
else
mkdir csv
echo -e "\033[0;31mDIRECTORY CREATED\033[0m"
echo -e "\033[0;35mINITIALIZING FILE SEARCH\033[0m"
sleep 1.5
echo -e "\033[0;33mCSV FILE SEARCH\033[0m"
echo -e "\033[0;33m----------------------------------------------------------------------------------------------------------------\033[0m"
if [ /*.csv ]
then
echo -e "CSV File Detected:\n"
sleep 2
ls ./*.csv
sleep 3
echo -e "Moving CSV Files to CSV Directory..\n"
mv ./*.csv ./csv
echo -e "Files Successfully moved!"
echo -e "\033[0;33m----------------------------------------------------------------------------------------------------------------\033[0m"
else
echo -e "No CSV Files Were Found!"
echo -e "\033[0;33m----------------------------------------------------------------------------------------------------------------\033[0m"
fi
break
fi
done