0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

複数のテキストファイルを, nkfを使い, UTF-8化(Linux / ubuntu)

Last updated at Posted at 2025-06-14

text file を UTF-8化

RHEL系では, iconv が(文字変換の)標準的な立ち位置ですね。
(個人的には)使い勝手は nkf が便利です。 ^^;

オペレーティングシステム

Operating System: Ubuntu 22.04.5 LTS
          Kernel: Linux 6.8.0-60-generic
    Architecture: x86-64

NKF をインストール

$ sudo apt install nkf

UTF-8化

#!/bin/bash

SMPL_D=../JCL_SAMPLE

# ------------------------------------------------
# MAIN
# ------------------------------------------------

        LANG=C
        cd $SMPL_D

        for I in $(ls *.txt)
        do
                (
                set -x
                /usr/bin/nkf -w --overwrite $I
                /usr/bin/nkf -g $I
                )
        done

exit 0
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?