Error: Bad character (ASCII 0) encountered. in data Fusion

436 Views Asked by At

I'm trying to import a file to Google Big Query. When I import it using a BigqueryJob, I get an error:

 Error detected while parsing row starting at position: 0. Error: Bad character (ASCII 0) encountered.

I've solved this by replacing the ASCII 0 character in notepad ++ or with PowerShell with the following Script:

   $configFiles = Get-ChildItem -Path C:\InputPath\* 
   foreach ($file in $configFiles)
   {
         (Get-Content $file.PSPath) |
         Foreach-Object { $_ -replace "`0", "" } |
         Set-Content $file.PSPath
   }

But I need to automate this, so I'm using Google Cloud DataFusion, but when I open this file with the wrapper, I get a screen with a Square symbol (Couldn't copy the character, so I pasted an image): ASCII 0 in DataFusion

What can I do to load this file with DataFusion?

If I open this same file in notepad/notepad++ I can see the characters like any other txt file. Thanks!

0

There are 0 best solutions below