タグ

csvに関するJxckのブックマーク (7)

  • The Absurdly Underestimated Dangers of CSV Injection

    I’ve been doing the local usergroup circuit with this lately and have been asked to write it up. In some ways this is old news, but in other ways…well, I think few realize how absolutely devastating and omnipresent this vulnerability can be. It is an attack vector available in every application I’ve ever seen that takes user input and allows administrators to bulk export to CSV. That is just about

    Jxck
    Jxck 2017/10/11
  • Excel: Error when CSV file starts with “I” and “D” | Hacker News

    Maybe my bug? I wrote most of the original Excel text-based file import code in 1984 (including the SLYK format, which was the main way we migrated files from Multiplan to Excel). Hi mckoss, awesome to hear one of the main Excel architects is here on HN!Any interesting stories to share? I think we'd all be interested. Mind if I ask a question directly related to one of my comments a few days ago?

    Jxck
    Jxck 2016/07/07
    I と D で始まる CSV を読むと発生するバグの相談に、その開発者が降臨したスレ
  • それでも独自のCSVを書くつもりですか? | POSTD

    一部誤訳の指摘があったため、修正しました!ご迷惑おかけして申し訳ございません! あなたは自分でCSVを書いてみたいですか? フィールドはコンマで区切り、行は改行で分けます。簡単ですよね。数行書けば勝手が分かるというものです。 でも、ちょっと待ってください。 フィールド内にコンマがある場合は? ダブルクォート(”)で、該当のフィールドを囲みましょう。簡単ですね。 では、ダブルクォートで囲めるフィールドに例外はあるのでしょうか? フィールド内にダブルクォートがある場合は? フィールド内の各ダブルクォートに対して、ダブルクォートを二重化して適用しましょう。そうすれば元のダブルクォートをエスケープすることができます。 なお、二重化したダブルクォートと空フィールドを囲んでいるダブルクォート( ...,"",... )を勘違いしないように気を付けてください。 フィールド内に改行がある場合は? その場合

    それでも独自のCSVを書くつもりですか? | POSTD
    Jxck
    Jxck 2014/11/13
    "RubyのCSVライブラリは2321行あるんですよ"
  • CSVファイルのデータ異常値を感覚的に捕まえるビューワ CSV Fingerprints

    Victor Powellさんが提案した CSV Fingerprints (CSVの指紋)は、CSVファイルのデータをデータの有無やデータの型(文字、数字など)に合わせて色づけすることで、日々の事務などで自動生成されて […] Victor Powellさんが提案した CSV Fingerprints (CSVの指紋)は、CSVファイルのデータをデータの有無やデータの型(文字、数字など)に合わせて色づけすることで、日々の事務などで自動生成されているCSV出力の異常な部分を、目視で発見できるようになるのでは、という提案です。 カラムのデータの型によって異なる色で塗ったのが上のような例。 図の上でクリックしながらマウスを動かすと、指している辺りが拡大表示され、セルの内容を確認することができます。 大きなデータセットの中から、異常になっている部分をすばやく特定し、その前後の値を含めて確認できる

    Jxck
    Jxck 2014/08/16
    面白い。
  • 7 Command-Line Tools for Data Science | Jeroen Janssens

    Data science is OSEMN (pronounced as awesome). That is, it involves Obtaining, Scrubbing, Exploring, Modelling, and iNterpreting data. As a data scientist, I spend quite a bit of time on the command-line, especially when there’s data to be obtained, scrubbed, or explored. And I’m not alone in this. Recently, Greg Reda discussed how the classics (e.g., head, cut, grep, sed, and awk) can be used for

    7 Command-Line Tools for Data Science | Jeroen Janssens
    Jxck
    Jxck 2013/09/20
    JSON, CSV, HTML 間の変換とか、データサイエンスじゃなくても十分便利。
  • How to generate CSV files in Rails

    Controller code : require 'csv' def export_to_csv@customers=CustomerInformation.find(:all) report = StringIO.new CSV::Writer.generate(report, ',') do |title| title << ['Id', 'Title', 'Job Title', 'First Name', 'Last Name'] @customers.each do |c| title < 'text/csv; charset=iso-8859-1; header=present',:filename => 'report.csv', :disposition =>'attachment', :encoding => 'utf8') end end end View: <% f

    How to generate CSV files in Rails
    Jxck
    Jxck 2011/04/12
  • Ruby on Rails Tips - CSV出力 - | Agenda Labs

    CSVを出力するサンプルです。 require 'csv' def csv report = '' CSV::Writer.generate(report, ',') do |csv| csv < < ['ID', '名前', '住所'] User.find(:all).each do |obj| csv << [obj.id, obj.name, obj.adress] end end send_data(NKF.nkf('-U -s -Lw', report), :type => 'text/csv; charset=shift_jis; header=present', :filename => "report-#{Time.now.strftime('%Y%m%d')}.csv\") end NKFでutf-8のデータをShift_jisに変化し、文字化けを防ぎます Rubyの標準

    Jxck
    Jxck 2011/04/12
  • 1