title: Python: Parsing a log file without convenient delimiters or fixed-width
body: <p>I am struggling with a stupidly simple problem. I am trying to parse a .log file that looks like the following:</p>
  
  <pre><code>#Software: Microsoft Internet Information Services 10.0
  #Version: 1.0
  #Date: 2020-03-31 00:00:40
  #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
  2020-03-31 00:00:40 172.33.22.75 GET /alcatel_tracfone_phone.html - 443 - 12.123.23.456 okhttp/3.12.1 - 200 0 0 32
  ...
  2020-03-31 00:01:03 172.33.22.75 GET /jose_laptop_windows.html - 443 - 170.173.81.52 curl/7.55.1 - 404 0 2 125
  </code></pre>
  
  <p>The columns are the following:</p>
  
  <pre><code>date 
  time 
  s-ip 
  cs-method 
  cs-uri-stem 
  cs-uri-query 
  s-port 
  cs-username 
  c-ip 
  cs(User-Agent) 
  cs(Referer) 
  sc-status 
  sc-substatus 
  sc-win32-status 
  time-taken
  </code></pre>
  
  <p>I want a Pandas table that has columns for each of the columns in the log file. Note that there isn't a convenient delimiter that can be used for neat parsing, nor is there a fixed width. This is simple in Excel and is probably simple in Python, but I've been struggling for a few hours without luck. Can someone provide a full code solution for me to study, please? </p>
  
  <p>UPDATE:</p>
  
  <p>Wow, I am dumb. Thanks so much all. I am not familiar with the <code>read_csv()</code> function and kept googling each step: 1. how to skip rows of a log file (to skip the first 4 rows), 2. I saw examples of others using the "fields" argument, but didn't realize it could be space delimited; 3. I didn't know a <code>.log</code> file could be treated the same as a <code>.csv</code>, or rather, be used as an input for a function called <code>read_csv()</code>.</p>