0

I have a file with fixed-width records that are not separated by newlines or any other terminator; the file is just a contiguous byte stream. Pandas read_fwf correctly reads the first record then stops. Is there a way to force read_fwf to continue reading all records to the end of file? I did not see any arg for this in the docs.

Lee
  • 405
  • 2
  • 10

1 Answers1

1

I don't know a good pandas solution. You might want to try pre-processing your input file using fold, awk, sed, etc. to the number of characters or bytes that should exist on each line. Check out this discussion: How to insert a new line character after a fixed number of characters in a file

Peter Leimbigler
  • 10,775
  • 1
  • 23
  • 37