<commit_before># Tag

`tag` is a *simple* command line audio tag editor.  It can view and modify tags
for any tag format recognized by [TagLib](http://taglib.github.com/) (e.g.
ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis
comments in FLAC, MPC, Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files).

## Usage

By default `tag` will print all audio tags it recognizes

    $ tag file.flac
    artist:  Kyuss
    album:   Muchas Gracias
    title:   Un Sandpiper
    track:   1
    year:    1997
    genre:   Rock
    comment: Track 1

If you specify more than one input file, then the tag for each file will be
printed one at a time.

The second operation of `tag` is to set audio tags

    $ tag file.flac --genre 'Stoner Rock' --year 2000
    $ tag file.flac
    artist:  Kyuss
    album:   Muchas Gracias
    title:   Un Sandpiper
    track:   1
    year:    2000
    genre:   Stoner Rock
    comment: Track 1

Note that arguments are subject to shell interpretation so be sure to put
single quotes around arguments with spaces etc.

See `tag --help` for a list of supported options.


## Examples

Set album name of all files in current folder (note that file without a tag
will be ignored):

    $ tag * --album Requiem

A tag with spaces or other characters that will be interpreted by the shell
need to be protected by single quotes.  If the tag contains a single quote,
e.g. as in *Mozart's Requiem*,  then it needs to be escaped like this:

    $ tag * --album 'Mozart'\''s Requiem'

Recursively find all flac files and summarize what genres they are:

    $ find . -type f -name '*.flac' -print0 | xargs -0 tag | grep 'genre:' | \
    > sed -e 's/genre://' | sort | uniq -c


## Known bugs

It is not possible to:

*   edit any other tags than the ones output by `tag filename`
*   delete tags or specify empty tags (e.g. it is only possible to clear the
    comment tag by `tag file --comment ' '`)
*   add tags to a file without tags

## Installation

Assuming you have the [Haskell Platform](http://www.haskell.org/platform/)
and [TagLib](http://taglib.github.com/) installed:

    $ cabal install
<commit_msg>Add another example to README<commit_after># Tag

`tag` is a *simple* command line audio tag editor.  It can view and modify tags
for any tag format recognized by [TagLib](http://taglib.github.com/) (e.g.
ID3v1 and ID3v2 for MP3 files, Ogg Vorbis comments and ID3 tags and Vorbis
comments in FLAC, MPC, Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files).

## Usage

By default `tag` will print all audio tags it recognizes

    $ tag file.flac
    artist:  Kyuss
    album:   Muchas Gracias
    title:   Un Sandpiper
    track:   1
    year:    1997
    genre:   Rock
    comment: Track 1

If you specify more than one input file, then the tag for each file will be
printed one at a time.

The second operation of `tag` is to set audio tags

    $ tag file.flac --genre 'Stoner Rock' --year 2000
    $ tag file.flac
    artist:  Kyuss
    album:   Muchas Gracias
    title:   Un Sandpiper
    track:   1
    year:    2000
    genre:   Stoner Rock
    comment: Track 1

Note that arguments are subject to shell interpretation so be sure to put
single quotes around arguments with spaces etc.

See `tag --help` for a list of supported options.


## Examples

Set album name of all files in current folder (note that file without a tag
will be ignored):

    $ tag * --album Requiem

A tag with spaces or other characters that will be interpreted by the shell
need to be protected by single quotes.  If the tag contains a single quote,
e.g. as in *Mozart's Requiem*,  then it needs to be escaped like this:

    $ tag * --album 'Mozart'\''s Requiem'

Recursively set genre of all songs in folder `Classical` (note that `tag` will
ignore folders and any non-music files, such as cover art etc.):

    $ find Classical -exec tag --genre Classical {} +

Recursively find artist for all songs under current folder, then print how many
songs each artist has in decreasing order (this may take a while if you have a
large library):

    $ find . -exec tag {} + | grep 'artist:' | sed -e 's/artist://' | sort | uniq -c | sort -bnr


## Known bugs

It is not possible to:

*   edit any other tags than the ones output by `tag filename`
*   delete tags or specify empty tags (e.g. it is only possible to clear the
    comment tag by `tag file --comment ' '`)
*   add tags to a file without tags

## Installation

Assuming you have the [Haskell Platform](http://www.haskell.org/platform/)
and [TagLib](http://taglib.github.com/) installed:

    $ cabal install

{'fraction_non_alphanumeric': 0.07747395833333333, 'fraction_numerical': 0.010416666666666666, 'mean_word_length': 2.969853574504737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '588493', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1398, 'n_words': 692}