LoginSignup
0
0

More than 5 years have passed since last update.

*.csvのファイル名の展開方法をスタック・オーバーフローで教えてもらった。

Posted at

(参考)awkで複数ファイルの入力(指定)にアスタリスクが使えますか?
https://ja.stackoverflow.com/questions/49250/awk%e3%81%a7%e8%a4%87%e6%95%b0%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e5%85%a5%e5%8a%9b%e6%8c%87%e5%ae%9a%e3%81%ab%e3%82%a2%e3%82%b9%e3%82%bf%e3%83%aa%e3%82%b9%e3%82%af%e3%81%8c%e4%bd%bf%e3%81%88%e3%81%be%e3%81%99%e3%81%8b

(内容)
ファイル名を1行で羅列します。

(環境)
win7
paste (GNU coreutils)5.3.0

ファイル名2個
csv1.csv
csv2.csv

(実行方法)
dir *.csv /b | paste -s -d " " > txt.txt

(txt.txtの内容)
csv1.csv csv2.csv

(参考)こんな方法があったのか! Windows用GNUコマンド群 「GNU utilities for Win32」
http://orangeclover.hatenablog.com/entry/20100801/1280657002

(実行時の問題点)
標準出力したら「write error:invalid argument」がでるので、
標準出力をあきらめて, >txt.txt にした。、
「invalid argument が出て動作しない問題」があるそうです。

(感想)dirとawkの連続技もありました。

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