0

I wrote a method in Java,

postingFile(" C:\Tables\A_env\A_Dif1.csv ") 

that reads the CSV file and process the data inside it. I got 26 environments, A through Z and I'm searching for a Java regular expression that can read and process data of 26 environments with single line of code.

I tried multiple combinations of Java regex but nothing worked.

Any help or guidance would be appreciated

dsh
  • 12,037
  • 3
  • 33
  • 51
Drithin
  • 51
  • 1
  • 4
  • 1
    Your question would be clearer if you gave some more context, and provided your best attempt at a solution for people to start with. As it is, it is rather unclear what exactly you are looking for. – dsh Jan 20 '17 at 18:09

1 Answers1

0

If your directories are named consistently like the example you presented, and you know the labels, as indicated, then you can simply compute each name.

For example:

char label = 'A';
for (int i = 0; i < 26 ; i += 1, label += 1)
    {
    final String path = "C:\\Tables\\"+label+"_env\\"+label+"_Dif1.csv";
    postingFile(path);
    }
dsh
  • 12,037
  • 3
  • 33
  • 51