-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
In order to prevent to put 100 dfq-files in the execution folder and get the json results in the same folder, it might be an idea to use a separate source and result folder. If you would like to do that, you might want to look at the method below. The files are put in the [execution folder]/dfq_source and the results are written into [execution folder]/json_result.
static void Main(string[] args)
{
var converter = new DfqConverter();
var location = System.Reflection.Assembly.GetEntryAssembly().Location;
var directory = Path.GetDirectoryName(location);
var directorySource = directory + "\\dfq_source";
var directoryResult = directory + "\\json_result";
var files = Directory.EnumerateFiles(directorySource, "*.dfq");
foreach (var file in files)
{
converter.Convert(file);
string newPath = directoryResult + "\\" + Path.GetFileNameWithoutExtension(file) + ".json";
File.WriteAllText(newPath, converter.GetJson());
}
}
Metadata
Metadata
Assignees
Labels
No labels