need to make a batch file in which we
traverse files in directory like D:\ named like base_pre_promo.csv,base_post_promo.csv
1) if it has pre in its name then data will be loaded in database in pre table
2) 1) if it has post in its name then data will be loaded in database in post table.
MySQL has a convenient command for loading CSV data into a table. I would wrap that in a PowerShell script that gets the CSV files. So it would look something like this:
I haven't tried this exact code, so there might be some bugs to iron out. I did ensure that a mysql commandof the type in the above code will work on PowerShell, including the expansion of the $table and $csv variables.