I have written a Powershell Script which will join the CSV Export Files from Victron and add the Date to a column. I will provide this as is and cannot guarantee that it works for all and with all future exports. But maybe it helps...
Copy the code into eg. Merge_Files.ps1 and load eg. in Powershell ISE
Please edit the variables at the top of the file.
I will not do any kind of support for the script! Its community based!
I am not at all affiliated with Victron and dont get paid or whatever for this.
<# Version: 1.0 Created on: 08.06.2020 Author: Thorsten Lambrecht Notes: IMPORTANT: Names of the CSV have to be: YYYY-MM-DD_AnyName.csv Date in the Name has to be date of the export, as this is the calculation base! The output file will by default be saved in the Script Directory Version: 1.0 Start Version #> $CSVFilesPath="c:\temp\VictronExports\*.csv" $OutFilePath=$PSScriptRoot #Get the List of all CSV Files $CSVFiles=Get-ChildItem -path $CSVFilesPath #Work on the CSV File by File $AllValues=foreach ($CSV in $CSVFiles) { #Import the Export-Date from the Filename of the file $DatumStr=($CSV.Name -split "_")[0] #Convert the Date to a PS Datetime $Datum=$DatumStr -as [datetime] #Import the current CSV and skip first element, as it is usually Day "0" and we dont know, #if day 0 is the complete value, unless values were exported at the end of the day in the dark #if you dont want to skip line "0" comment "-Skip 1" Line with a # #Values will be converted to appropriate types, as the general import would put them to NoteProperty. #Dont know if the errors are really int values, as I never had errors! $CurrentFileImport=Import-Csv -Path $CSV.FullName -Delimiter "," | ` select-object ` -Skip 1 ` @{Name="Date";Expression={$Datum.AddDays(-($_.'Days ago'))}},` @{Name="Date exported";Expression={$Datum}},` @{Name="Days ago";Expression={[int32]$_.'Days ago'}},` @{Name="Yield(Wh)";Expression={[int32]$_.'Yield(Wh)'}},` @{Name="Consumption(Wh)";Expression={[int32]$_.'Consumption(Wh)'}},` @{Name="Max. PV power(W)";Expression={[int32]$_.'Max. PV power(W)'}},` @{Name="Max. PV voltage(V)";Expression={[Single]$_.'Max. PV voltage(V)'}},` @{Name="Min. battery voltage(V)";Expression={[Single]$_.'Min. battery voltage(V)'}},` @{Name="Max. battery voltage(V)";Expression={[Single]$_.'Max. battery voltage(V)'}},` @{Name="Time in bulk(m)";Expression={[int32]$_.'Time in bulk(m)'}},` @{Name="Time in absorption(m)";Expression={[int32]$_.'Time in absorption(m)'}},` @{Name="Time in Single(m)";Expression={[int32]$_.'Time in Single(m)'}},` @{Name="Last error";Expression={[int32]$_.'Last error'}},` @{Name="2nd last error";Expression={[int32]$_.'2nd last error'}},` @{Name="3rd last error";Expression={[int32]$_.'3rd last error'}},` @{Name="4th last error";Expression={[int32]$_.'4th last error'}} $CurrentFileImport } #Now Group the values by Date, so that we see, which dates are overlapping $Grouped=$AllValues | group-object -Property Date #Now make a clean list, which will take only the Date-Line with the highest Yield, as this seems the full value $CleanedList=foreach ($Group in $Grouped) { ($Group.Group | sort-object -Property 'Yield(Wh)' -Descending)[0] } #Export both lists to files. "AllValues.csv" is more as a reference to see, which lines have been doubled #Output will be sorted Ascending, if you want Descending, add "-Descending" $AllValues | Sort-Object -Property Date | Export-Csv $OutFilePath\AllValues.csv -NoTypeInformation -Force $CleanedList | Sort-Object -Property Date | Export-Csv $OutFilePath\CleanedList.csv -NoTypeInformation -Force