I have a java program that's extracting a date from the contents of a file, and then renaming the file with that date string. What I need to account for is that the new file name may end up having the date at the beginning, in the middle, or at the end. What I was trying to do was something like this -
String outputFilePt1 = args[0];
String outputFilePt2 = args[1];
String outputFilePt3 = args[2];
String outputDate = dateFormat.format( date );
String newOutputFile = outputFilePt1 + outputFilePt2 + outputFilePt3;
I would then enter something like "MyFile_", "outputDate", ".csv" for args 0-2, respectively, hoping that the result would be MyFile_outputDatesValue.csv - because I may need it to be MyFile.csv_outputDatesValue
What would be the best way to accomplish taking 3 inputs - FilePart1, FilePart2, FilePart3 where one would end up with the value of "outputDate" in the above code block?
Thanks in advance, I hope what I'm asking makes sense!
EDIT - I do not know the value of "outputDate" at the time I input the arguments. This is calculated based on the input file and a config/properties file that determines the date format/location of the input file.