« Deckadance | トップページ | [Numbers]16進数を10進数に変換する HEX2DEC »

[file]テキストファイルの文字コードと改行コードを調べる

Website_image20120115_214720

------ファイルを選択
set theFileAlias to (choose file) as alias
------選択したファイルのUNIXパスを取得
set theUnixPass to POSIX path of theFileAlias
------fileコマンドを整形
set theDoFileCom to "file" & " \"" & theUnixPass & "\""

----theChrCodeが文字コード
set theChrCode to do shell script theDoFileCom & " | awk -F\" \" '{print($2)}' "

----theLineTerminatorsが改行コードLFnullなのでif文で補足しLFの値も作る
set theLineTerminators to do shell script theDoFileCom & " | awk -F\" \" '{print($6)}' "

if theLineTerminators is "" then
set theLineTerminators to "LF"
end if


「theDoFileCom.rtf」をダウンロード

「theDoFileCom.scpt.zip」をダウンロード

|

« Deckadance | トップページ | [Numbers]16進数を10進数に変換する HEX2DEC »

AppleScriptCharacter」カテゴリの記事

トラックバック


この記事へのトラックバック一覧です: [file]テキストファイルの文字コードと改行コードを調べる:

« Deckadance | トップページ | [Numbers]16進数を10進数に変換する HEX2DEC »