You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
追記(2020-12-16): 公式で再実装されたようです。 「タグの一括編集機能」をPCのブラウザで再提供いたします - はてなブックマーク開発ブログ はてなブックマークで自分のブックマークの既存のタグ名を変更した時に一括置換したいことがあります。 以前は公式のタグの一括置換/削除機能の追加がありましたが、ブックマーク一覧ページのリニューアル時に消えてしまったようです。 ユーザーのブックマーク一覧ページのシステムリニューアルを行いました - はてなブックマーク開発ブログ Firefoxのアドオン版でも同様の機能がありましたが、もう動かなくなっているので、はてなブックマークのタグを一括置換するコマンドラインツールを書きました。 azu/hatenabookmark-rename-tags: A CLI that replace all hatena bookmark tags. haten
ファイルリネーマを書いた。引数に置換パターン、置換後文字列、ファイル名を渡すと、ファイル名を置換してくれる。正規表現は、インストールしている sed がサポートするものとなる。 #!/bin/sh if [ $# -gt 1 ]; then Pattern=$1 shift; for file in "$@" do if [ -f "$file" ]; then orgname=$( basename "$file" ); dir=$( dirname "$file" ); newname=$( echo -n "$orgname" | sed -e "$Pattern" ); if [ "$dir/$orgname" != "$dir/$newname" ]; then echo "$dir/$orgname -> $dir/$newname" mv "$dir/$orgname" "$
コマンド $ ls | sed -e s/\.txt// | awk '{print $1 ".txt " $1 "_document.md"}' | xargs -n 2 mv 戦略について まず前提として、ファイルのリネームを行うには、 xargs -n 2 mv にパイプで 元ファイル名 リネーム後のファイル名 のようなフォーマットの文字列を渡せば OK です。 $ ls before.txt $ echo "before.txt after.txt" before.txt after.txt $ echo "before.txt after.txt" | xargs -n 2 mv $ ls after.txt この文字列が複数行ある場合、 xargs -n 2 mv は1行ずつ順次処理します。 $ ls 1.txt 2.txt $ echo "1.txt 11.txt\n2.tx
pandas.DataFrameの行名(index, インデックス)・列名(columns)を変更するには、rename()メソッドやset_axis()メソッドなどを使う。 既存の列をインデックスに設定するset_index()というメソッドもある。 関連記事: pandas.DataFrameの列をインデックス(行名)に割り当てるset_index 本記事のサンプルコードのpandasのバージョンは以下の通り。バージョンによって仕様が異なる可能性があるので注意。以下のpandas.DataFrameを例として使う。 import pandas as pd print(pd.__version__) # 2.0.3 df = pd.DataFrame({'A': [11, 21, 31], 'B': [12, 22, 32], 'C': [13, 23, 33]}, index=['ON
Emacs で wdired と moccur-edit を使っていない人は(ry と思ったので紹介します。 wdired wdired ではファイルのリネームが超簡単になります。 mv やエクスプローラで F2 を押してリネームをしている人は wdired を使うべし。 dired で ~/tmp を表示すると以下の様になっているとします。 /home/taro/tmp: 合計 273 drwxr-xr-x 6 taro taro 928 2006-12-26 10:41 . drwxr-xr-x 66 taro taro 3632 2006-12-26 10:25 .. -rw-r--r-- 1 taro taro 2232 2006-11-24 21:36 EndsWithTest.cpp -rw-r--r-- 1 taro taro 670 2006-11-24 21:24 End
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く