I have a CSV which has the follwing data
time t_count state hour
_____ ________ _____ _____
1 10 2 1
2 12 2 1
3 30 2 1
4 12 2 1
1 9 3 1
2 18 3 1
6 27 3 1
1 18 4 1
2 30 4 1
9 27 4 1
.......................................
......................................
2 30 2 2
8 18 2 2
3 36 2 2
3 6 3 2
6 19 3 2
8 28 3 2
1 19 4 2
2 36 4 2
9 30 4 2
.....................................
.....................................
....................................
Likewise I have time and t_count for each state and each hour.I have state form 2 to 99 and hour from 1 to 23.So I need to split this CSV into each CSV for each state and each hour as
state_2_hour_1.csv
1 10 2 1
2 12 2 1
3 30 2 1
4 12 2 1
state_3_hour_1.csv
1 9 3 1
2 18 3 1
6 27 3 1
...
state_2_hour_2.csv
2 30 2 2
8 18 2 2
3 36 2 2
and so on.Any help is appreciated.