1

I have a .dat file with values separated by spaces. However, the spaces are irregular (some columns separated by one space, some by eight spaces) and some columns also have strings with spaces in them. For example, the first five lines look like this:

  CURRENCY DATE = 04/19/20
                                     LATITUDE    LONGITUDE     OBSTACLE            AGL   AMSL LT ACC MAR FAA         ACTION
OAS#      V CO ST CITY            DEG MIN SEC   DEG MIN SEC   TYPE                 HT    HT     H V IND STUDY           JDATE
-------------------------------------------------------------------------------------------------------------------------------
06-159571 U US CA IMPERIAL BEACH   32 31 54.66N 117 11 11.20W TOWER              1 00006 00007 N 4 D N 2016AWP08468OE A 2018027

As you can see, "IMPERIAL BEACH" is a city and should be counted as one column, but "CA" is a state and separated from the city column with only one space. Some cities also only have one word, so using just a single space (" ") delimiter doesn't work. Is there any way to process this large data set into a usable dataframe in Python?

Smith
  • 11
  • 2

1 Answers1

0

Figure it out! Just loaded the .dat file into Microsoft Excel.

Smith
  • 11
  • 2