Last active
February 15, 2016 21:38
-
-
Save u1and0/4b720bd0a2c4683388a6 to your computer and use it in GitHub Desktop.
gnuplotで規則性のないファイル一覧を連続で描画して動画風にする ref: http://qiita.com/u1and0/items/82c748c1b84aec17d612
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
outdrct='C:\home\gnuplot\160101\' #outdrctにrootディレクトリ格納 | |
outdrct2='C:/home/gnuplot/160101/' #outdrctにrootディレクトリ格納 | |
drctpath=sprintf("%srawdata\\trace",outdrct) # drctpathに目的のディレクトリ入れる(ココまではつなげてしまっても良い) | |
do for [i =1:100]{ | |
command=sprintf('dir %s /b | awk "NR==%4.0f{print}"',drctpath,i) # ファイル名一覧を出力するdir /bしてパイプでawkに渡す | |
data=system(command) | |
print sprintf("%4.0f番目のファイルは%sです。",i,data) | |
dataname=outdrct2.'rawdata/trace/'.data | |
plot dataname | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
outdrct='C:\home\gnuplot\160101\' #outdrctにrootディレクトリ格納 | |
outdrct2='C:/home/gnuplot/160101/' #outdrctにrootディレクトリ格納 | |
# cd outdrct.'rawdata/trace' | |
drctpath=sprintf("%srawdata\\trace",outdrct) # drctpathに目的のディレクトリ入れる(ココまではつなげてしまっても良い) | |
command=sprintf('dir %s /b | awk "{print}"',drctpath) # ファイル名一覧を出力するdir /bしてパイプでawkに渡す | |
list=system(command) | |
do for [data in list]{ | |
dataname=outdrct2.'rawdata/trace/'.data | |
p[][-150:0] dataname w l lc "grey40" title data | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 foo.txt | |
2 bar.exe | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir "C:\home" /b | awk "{print NR,$0}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir "C:\home" /b | awk "NR== 4,NR==7 {print NR,$0}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment