title: How to remove empty space from front of JSON object?
body: <p>I am trying to process a large JSON file using the follow code:</p>
  <pre><code>dctx = zst.ZstdDecompressor(max_window_size=2147483648)
  with open(filename+&quot;.zst&quot;, 'rb') as infile, open(outpath, 'wb') as outfile:
      dctx.copy_stream(infile, outfile)
      
  with pd.read_json(filename+&quot;.json&quot;, lines=True, chunksize=5000) as reader:
          reader
          # Making list of column headers
          df_titles = []
          for chunk in reader:
              chunk_titles = list(chunk.keys())
              df_titles.extend(chunk_titles)
              df_titles = list(set(df_titles))
  </code></pre>
  <p>However, when I attempt to run the code, I get an error message: <code>ValueError: Expected object or value</code>. The file is formatted with one JSON object per line, and looking at the JSON file itself, it seems the issue is that one of the JSON objects has a bunch of empty space in front of it. <a href="https://i.stack.imgur.com/li5Q9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/li5Q9.png" alt="Empty space" /></a><a href="https://i.stack.imgur.com/b74zo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b74zo.png" alt="enter image description here" /></a></p>
  <p>If I manually delete the 'nul' line, the file processes with no issues. However, for the sake of reproducibility, I would like to be able to address the issue from within my code itself. I'm pretty new to working in Python, and I have tried googling the issue, but solutions seem to focus on removing white space from the beginning of JSON values, rather than the start of a line in this kind of file. Is there any easy way to deal with this issue either when decompressing the initial file, or reading the decompressed file in?</p>