Reputation: 41
I have time series data as follow:
L1_0101_0601_A L1_0101_0603_A L1_0101_0605_B L1_0101_0608_B L1_0101_0610_C L1_0101_0612_C L1_0101_0615_A L1_0101_0617_A L1_0101_0619_A L1_0101_0622_B L1_0101_0624_B L1_0101_0626_C L1_0101_0629_C L1_0101_0631_A L1_0101_0633_A L1_0101_0635_B L1_0101_0638_B L1_0101_0640_C L1_0101_0642_C L1_0101_0645_A L1_0101_0647_A L1_0101_0649_A
and so on.
I want to keep the files conditionally. I want to keep only two continuous files ending A, B and C. In the file list, sometimes, there are three continuous files ending A or B or C. At that time, I want to remove the last file.
In this example, I would like to drop "L1_0101_0619_A" and "L1_0101_0649_A" because it is the third files ending A. I will keep other twos. Like this, there are several files which I would like to remove.
Upvotes: 1
Views: 89