Denoを使って巨大なCSVファイルを開く機会があったので、その方法の覚え書きです。 DenoでCSVを読み書きする方法(通常ver.) 通常、DenoでCSVを読むには、標準ライブラリのparse関数を使います。 import * as CSV from "https://deno.land/std@0.170.0/encoding/csv.ts"; // ↓直接pathに文字列を指定するとカレントディレクトリからの相対パス。import.meta.resolveを使用するとこのファイルからの相対パス。 const path = new URL(import.meta.resolve("./path/to/file")); const text = await Deno.readTextFile(path); // ファイルを文字列として読み取り const data = CSV.par
Windows版PHP(xampp) の fgetcsv() が、php-5.6 と php-7.1 で挙動が変わったことがわかった。 たぶん php-7.0 から。 fgetcsv() はlocaleに依存する関数なので、 UTF8のCSVを読み込むなら ja_JP.UTF-8 を指定する必要があるとマニュアルにもあるのだけど、 Windowsではそもそも UTF-8 ロケールを指定できない。 php-5.6 では特に何も指定せず、デフォルトの Japanese_Japan.932 のままでもUTF8のファイルを読み込めていた・・たぶん。 手元の開発環境でしかないから、テストケースが少なかった可能性はあるけども。 ともかく挙動は変わっている。 php7以降では、Windowsの場合は C ロケールを設定する必要がある模様。 挙動が違う例 <?php $strCsv = '"サーロイン",
Unfortunately a quick google search on “ASCII Delimited Text” shows that IBM and Oracle failed to read the ASCII specification and both define ASCII Delimited Text as a CSV format. ASCII Delimited Text should use the record separators defined as ASCII 28-31. The most common formats are CSV (Comma Separated Values) and tab delimited text. Tab delimited text breaks when ever you have either a fiel
Features: Eleven Awesome Things You Can Do with csvkit A Listicle Introduction to the Swiss Army Knife of CSVs csvkit Back in 2009, Aaron Bycoffe inspired Joe Germuska to write a thirty-line Python script called csvcut for making it easy to select a subset of columns from a CSV file. For the next two years the two of them went back and forth forking and making small revisions to this tool. We got
CSV is a simple and common format for tabular data that uses commas to separate rows and columns. Nearly every spreadsheet and database program lets users import from and export to CSV. But until recently, these programs varied in how they treated special cases, like when the data itself has a comma in it. It's easy to make a mistake when you try to make a CSV file fit a particular format. To make
So You Want To Write Your Own CSV code? 25 May 2014 So You Want To Write Your Own CSV code? Fields separated by commas and rows separated by newline. Easy right? You can write the code yourself in just a few lines. Hold on a second… What if there are commas inside the fields? You need to enclose the field with quotes (“). Easy right? But can only some fields but not all be quoted? What if there ar
I wanted to make a stand-alone CSV conversion tool that would run exclusively on Github, allowing anyone to fork, upload and manage their open data via simple web interface. This project runs as a Github Page, building on a Github Repository and is built entirely in JavaScript, which means there is no server backend beyond Github. This allows you to fork and implement without launching your websit
I've recently completed a project to compile publicly-available NFL play-by-play data. It took a while, but now it's ready. The resulting database comprises nearly all non-preseason games from the 2002 through [edit: 2012] seasons. I have not performed any analysis on the data, so what you'll get are the only basics--time, down, distance, yard line, play description, and score. It's almost exactly
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く