Google Play Console reports are using UTF-16 encoding, BigQuery - UTF-8.
How I can automatic converting the CSV files from UTF-16 to UTF-8?
My code in PowerShell:
$date = (Get-Date).AddDays(-2).Date.ToString('yyyy-MM')
$date2 = $date.Replace('-', '')
$typefile = 'app_version'
$table = $typefile + '$' + $date2 + '01'
$csv_file = 'gs://pubsite_prod_rev_******_'+ $date2 + '_' + $typefile + '.csv'
$csv_file2 = $date2 + '_' + $typefile + '.csv'
& gsutil cp $csv_file C:\***\Scripts\gc\$csv_file2
& bq load --replace report.$table C:\***\Scripts\gc\$csv_file2
Error:
BigQuery error in load operation: Error processing job
'majestic-cairn-****:bqjob_r171ebea2_*****_1': Error while reading
data, error message: CSV table encountered too many errors, giving up. Rows: 1;
errors: 1. Please look into the error stream for more details.
Failure details:
- file-00000000: Error while reading data, error message: Too many
values in row starting at position: 0.