I am collecting performance counters from NetApp Performance Manager software (OPM). OPM saves 30 days worth of data in MySQL database. So i have to put two queries to retrieve the data:
- First Query on 30th of every month and save in csv file.
- Second Query on 1st of every month and save in csv file.
Then merge the two csv files to get data if there are 31 days in a month.
Both files look like below:
"Time","objid","cpuBusy","cifsOps","avgLatency"
"2016:06:04 00:04","72","50.6196","2069.11","7622.1"
"2016:06:04 00:09","72","30.2233","2075.94","7633.27"
"2016:06:04 00:14","72","35.2559","1980.64","8352.17"
When i merge the two csv files with below code. I get duplicate rows with data from same data/time.
@(Import-Csv au2004npsa003-mm-business.csv) + @(Import-Csv au2004npsa003-nn-business.csv) | export-csv joined.csv -NoTypeInformation
How can i merge the two csv files without getting duplicate data?
I have tried select -unique
however, it gives just one row.