I am new to a c++ programing and currently working on my college projct. I have to create a csv file which take data from the CAN connected to the PC and store it into it. I wanted to create a CSV file which has Name as a current Timing and it has to store inside the particular Folder which has Name as a current date. I am able to create the Folder which has Name as a current date but not able to create a csv file.
In more clear way, For example: Today is 01/05/2017so the Folder Name should be "01052017" and I run the Code at 02:30:50 then CSV file should have the Name "023050.csv". and if I run the Code again for example at 03:30:10 then csv file should be created in the same Folder with the Name "033010.csv" but if the date Change then new Folder should be created.
What exactly is the problem?
To get the filename you need to get the current time and create the filename from it. To find the correct folder you need to get the current date and see if the folder exists, if not it means it's the first file of this day and you create the folder and safe the file into it.
@kbw
I add my Code for creating Folder. And now i wanted to create a csv file which will be create in the Folder which named as a current date (for example: 01052017).
@Thomas1965
Hey, Thanks. It is working well. Thank you very much. I have one more question if you can help.... As per this Code, we will get Folder where Project is saved. Can we also Change the path of creating Folder?