Open Dataset
Data Structure ?
103.49M
Data Structure ?
*The above analysis is the result extracted and analyzed by the system, and the specific actual data shall prevail.
README.md
# データセット:あなたのコンピュータ上のファイル
CrabはMacとWindows用のコマンドラインツールで、ファイルデータをSQLiteデータベースにスキャンします。そのため、そのデータに対してSQLクエリを実行できます。
例:(Windows) C:> crab C:\some\path\MyProject
または (Mac) $ crab /some/path/MyProject
あなたはCRAB>プロンプトを得ることができ、そこでデータに対するSQLクエリを入力できます。例えば、拡張子ごとにファイルをカウントする。
SELECT extension, count(*)
FROM files
GROUP BY extension;
例:最も大きい5つのディレクトリをリストする
SELECT parentpath, sum(bytes)/1e9 as GB
FROM files
GROUP BY parentpath
ORDER BY sum(bytes) DESC LIMIT 5;
Crabは仮想テーブルfileslinesを提供します。これはファイルの内容をSQLに公開します。
例:任意の.cファイル内のTODOとFIXMEエントリを再帰的にカウントする
SELECT fullpath, count(*) FROM fileslines
WHERE parentpath like '/Users/GN/HL3/%' and extension = '.c'
and (data like '%TODO%' or data like '%FIXME%')
GROUP BY fullpath;
また、ファイルの任意のサブセット、またはファイル内の行に対してプログラムやシェルコマンドを実行する関数もあります。例えば(Mac)、すべての.zipファイルを再帰的に解凍する
SELECT exec('unzip', '-n', fullpath, '-d', '/Users/johnsmith/Target Dir/')
FROM files
WHERE parentpath like '/Users/johnsmith/Source Dir/%' and extension = '.zip';
(ここで-nは_unzip_に何も上書きしないように指示し、-dはターゲットディレクトリを指定します)
クエリ出力をファイルに書き込む関数もあります。例えば(Windows)、ディレクトリ内のすべての.txtファイルの行をソートし、新しいファイルに書き込む
SELECT writeln('C:\Users\SJohnson\dictionary2.txt', data)
FROM fileslines
WHERE parentpath = 'C:\Users\SJohnson\' and extension = '.txt'
ORDER BY data;
対話型プロンプトの代わりに、バッチモードでクエリを実行することもできます。例えば、現在のディレクトリ内のすべてのファイルの完全パスを返すワンライナーは次の通りです
C:> crab -batch -maxdepth 1 . "SELECT fullpath FROM files"
Crab SQLはWindowsバッチファイルやBashスクリプトでも使用できます。例えば、ETL処理に使用できます。
**Crabは個人使用には無料で、商用は月額5ドルです**
詳細はこちら(Mac):[http://etia.co.uk/][1] またはこちら(Windows):[http://etia.co.uk/win/about/][2] を参照してください。
あなたが遊ぶためのサンプルSQLiteデータベース(Macデータ)がアップロードされています。これには、Project Gutenbergコーパスをダウンロードしたときに得られるディレクトリツリーのサンプルfilesテーブルが含まれており、95,000個のディレクトリと123,000個のファイルが含まれています。
あなた自身のファイルをスキャンし、仮想テーブルやサポート関数にアクセスするには、Crab SQLiteシェルを使用する必要があります。これはこのページ(Mac):[http://etia.co.uk/download/][3] またはこのページ(Windows):[http://etia.co.uk/win/download/][4] からダウンロードできます。
# 内容
FILESテーブル
FILESテーブルには、スキャンされたすべての項目(ファイルまたはディレクトリ)の詳細が含まれています。'mode'を除くすべての列にインデックスが付けられています。
列
fileid (int) 主キー -- filesテーブルの行番号、各項目に対する一意のID
name (text) -- 項目名、例:'Hei.ttf'
bytes (int) -- 項目のサイズ(バイト)、例:7502752
depth (int) -- 項目を見つけるためにスキャンが再帰的に進んだ深さ、0から始まる
accessed (text) -- 項目がアクセスされた日時
modified (text) -- 項目が変更された日時
basename (text) -- パスや拡張子を除いた項目名、例:'Hei'
extension (text) -- ドットを含む項目の拡張子、例:'.ttf'
type (text) -- 項目のタイプ、ファイルの場合は'f'、ディレクトリの場合は'd'
mode (text) -- さらなるタイプ情報とパーミッション、例:'drwxr-xr-x'
parentpath (text) -- 項目を含むディレクトリの絶対パス、例:'/Library/Fonts/'
fullpath (text) 一意 -- 項目のparentpathとその名前を連結したもの、例:'/Library/Fonts/Hei.ttf'
パス
1) parentpathとfullpathは、~ . や .. のような省略形をサポートしていません。単なる文字列です。
2) ディレクトリパスの末尾にはすべて'/'があります。
FILESLINESテーブル
FILESLINESテーブルは、ファイルのデータ内容をクエリするためのものです。行番号とデータの列があり、Crabによってスキャンされた各ファイルの各行データに対して1行が存在します。
このテーブルはサンプルデータセットでは利用できません。なぜなら、これは仮想テーブルであり、物理的にデータを含んでいないからです。
列
linenumber (int) -- ファイル内の行番号、各ファイルの最初の行から1からカウントを再開する
data (text) -- ファイルのデータ内容、各行に1つのエントリ
FILESLINESはまた、FILESテーブルの列(fileid、name、bytes、depth、accessed、modified、basename、extension、type、mode、parentpath、およびfullpath)を複製しています。このようにすることで、テーブルを結合する必要なく、検索対象のファイルを制限できます。
# サンプルのGutenbergデータ
あなたが遊ぶためのサンプルSQLiteデータベース(Macデータ)_database.sqlite_がアップロードされています。これには、Project Gutenbergコーパスをダウンロードしたときに得られるディレクトリツリーのサンプル_files_テーブルが含まれており、95,000個のディレクトリと123,000個のファイルが含まれています。
任意のSQLiteシェルで開くことも、任意のSQLiteクエリツールでクエリを実行することもできますが、_fileslines_などの仮想テーブルやEXEC()やWRITELN()などのサポート関数は、etia.co.ukからダウンロードしなければならないCrabシェルからのみ機能します。
# 用途
* ファイルシステムの内容のレポートと分析
* ファイルやディレクトリの検索
* ファイルの移動、コピー、削除、解凍などのファイルシステム操作
* ETL処理
[1]: http://etia.co.uk/
[2]: http://etia.co.uk/win/about/
[3]: http://etia.co.uk/download/
[4]: http://etia.co.uk/win/download/
×
The dataset is currently being organized and other channels have been prepared for you. Please use them
The dataset is currently being organized and other channels have been prepared for you. Please use them
Note: Some data is currently being processed and cannot be directly downloaded. We kindly ask for your understanding and support.
No content available at the moment
No content available at the moment
- Share your thoughts
Go share your ideas~~
ALL
Welcome to exchange and share
Your sharing can help others better utilize data.
Data usage instructions: h1>
I. Data Source and Display Explanation:
- 1. The data originates from internet data collection or provided by service providers, and this platform offers users the ability to view and browse datasets.
- 2. This platform serves only as a basic information display for datasets, including but not limited to image, text, video, and audio file types.
- 3. Basic dataset information comes from the original data source or the information provided by the data provider. If there are discrepancies in the dataset description, please refer to the original data source or service provider's address.
II. Ownership Explanation:
- 1. All datasets on this site are copyrighted by their original publishers or data providers.
III. Data Reposting Explanation:
- 1. If you need to repost data from this site, please retain the original data source URL and related copyright notices.
IV. Infringement and Handling Explanation:
- 1. If any data on this site involves infringement, please contact us promptly, and we will arrange for the data to be taken offline.
- 1. The data originates from internet data collection or provided by service providers, and this platform offers users the ability to view and browse datasets.
- 2. This platform serves only as a basic information display for datasets, including but not limited to image, text, video, and audio file types.
- 3. Basic dataset information comes from the original data source or the information provided by the data provider. If there are discrepancies in the dataset description, please refer to the original data source or service provider's address.
- 1. All datasets on this site are copyrighted by their original publishers or data providers.
- 1. If you need to repost data from this site, please retain the original data source URL and related copyright notices.
- 1. If any data on this site involves infringement, please contact us promptly, and we will arrange for the data to be taken offline.