What's the best method for parsing out data from a messy text file? or Struggling with parsing out va

22 Replies, 1603 Views

Thanks for all the tips, folks! I tried `jq` for the nested JSON bits, and it’s *way* better than my janky Python script.

Still struggling with the timestamp chaos though—some are Unix, some are ISO, ugh.

Anyone got a magic regex for mixed timestamp formats? Or should I just write a bunch of `try-except` blocks with `dateutil`?
I’ve been there. My hack? Use `sed` to normalize the mess first—replace random spaces with tabs, strip garbage chars, etc.

*Then* try parsing out the good stuff.

Also, `csvkit` is weirdly useful for log files if you can fake them into CSV format.



Users browsing this thread: 1 Guest(s)