Conversation
| # The format to convert from, either YDVR or TeamSurv. | ||
| [string]$Format = "YDVR" | ||
| ) | ||
|
|
There was a problem hiding this comment.
Add something like this here:
$inExtension = switch ( $Format )
{
YDVR { "dat" }
TeamSurv { "tsv"}
}
This will set the input file extension to use in a variable called $inExtension.
Then when you do the filtering below, try something like:
$AllFiles = Get-ChildItem -Path $OutputFolder -Filter "*.$inExtension" -Recurse
| # without printing every single coordinate. | ||
| $summaryError = $results | Where-Object { $_ -like "*error:*" } | Select-Object -First 3 | ||
|
|
||
| Write-Host " Reason: Data is missing required properties (depth/time)." -ForegroundColor Yellow |
There was a problem hiding this comment.
Should this instead say something like "Partial validation errors were..."? My worry is that validation errors may not have anything to do with the data (e.g., depth or time), but only the metadata, so the current message may cause confusion (especially since it is truncating the output).
| $summaryError = $results | Where-Object { $_ -like "*error:*" } | Select-Object -First 3 | ||
|
|
||
| Write-Host " Reason: Data is missing required properties (depth/time)." -ForegroundColor Yellow | ||
| Write-Host " Partial error output: Data is missing required properties (depth/time)." -ForegroundColor Yellow |
There was a problem hiding this comment.
Stating that it is a partial error output is good. I also think removing "(depth/time)" would be a good idea, since the errors may have nothing to do with the data, so this may confuse rather an elucidate.
The previous version of this script filtered out any data that wasn't a .DAT meaning that even though Logconvert.exe works on .TSVs individually, the script wouldn't accept .TSVs in mass. This , thanks to a change in line 114, accepts both .TSV and .DAT and turns the entire directory into Wibl