<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>SedimentHydraulics</author_name>
  <author_url>https://blog.hatena.ne.jp/SedimentHydraulics/</author_url>
  <blog_title>趣味で計算流砂水理 Computational Sediment Hydraulics for Fun Learning </blog_title>
  <blog_url>https://computational-sediment-hyd.hatenablog.jp/</blog_url>
  <categories>
    <anon>R</anon>
  </categories>
  <description>データを扱っていると、どうしようもないテキストファイルってあると思いますが、それを読み込むときのテンプレートです。 # とりあえずエンコードを指定して開く with open(filepath, mode='r', encoding='shiftJIS') as response: # skip header n回 for _ in range(n) : l = next(response) #try文でファイルの終わりまで(errorがでるまで)ループ try: while True: #一行読んで改行を置換 l = next(response) ll = l.replace('\n',''…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcomputational-sediment-hyd.hatenablog.jp%2Fentry%2F2023%2F12%2F13%2F014642&quot; title=&quot;備忘録：Pythonでどうしようもないテキストファイルの読み込み方 - 趣味で計算流砂水理 Computational Sediment Hydraulics for Fun Learning &quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-12-13 01:46:42</published>
  <title>備忘録：Pythonでどうしようもないテキストファイルの読み込み方</title>
  <type>rich</type>
  <url>https://computational-sediment-hyd.hatenablog.jp/entry/2023/12/13/014642</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
