help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] group


From: Val Krem
Subject: [Help-bash] group
Date: Sat, 10 Dec 2016 19:52:22 +0000 (UTC)

Hi all,

In one folder a I have several files( >200). These files do have the same 
columns(variables).  The file names do have two patterns and want concatenate 
these files into two groups based on their file name pattern.

The file names look like as follow.
Region-19940726.csv
Region-19940816.csv
Region-19940920.csv
Region-19941018.csv
Region-19941122.csv
Region.csv
RegionAB-19940726.csv
RegionAB-19940816.csv
RegionAB-19940920.csv
RegionAB-19941018.csv
RegionAB-19941122.csv
RegionAB.csv

The first file (file1)  should include all files that starts with 'RegionAB' 
and inlcude the following files

RegionAB-19940726.csv
RegionAB-19940816.csv
RegionAB-19940920.csv
RegionAB-19941018.csv
RegionAB-19941122.csv
RegionAB.csv

The second output  file  (file2) should include all files that start with 
'Region'

Region-19940726.csv
Region-19940816.csv
Region-19940920.csv
Region-19941018.csv
Region-19941122.csv
Region.csv

Is there an efficient way of doing this?

thank you in advance


reply via email to

[Prev in Thread] Current Thread [Next in Thread]