Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイルの各行で特定の範囲の文字を置き換える必要があります。
私はこれを試しました
perl -i -pe 'r77,79c/XXX/g' file
77文字目から79文字目XXXをPerlで変更したいのですが、上記のコードがうまくいきません。
XXX
位置 [77-79] の文字を XXX に置き換えますか?
試す
perl -i -piorig_* -e "substr($_,76,3)=XXX" file
データ損失の可能性を防ぐために、orig_file というバックアップ ファイルが作成されます。