Total Pageviews

Blog Archive

Teaching (241) Mathematica (158) 3Q (50) Excel (45) SPSS (32) Cat (24) LaTeX (23) Mac (22) 君達呀 (15) Kaohsiung (14) 論文測試 (13) Mathematica教學講義 (3)

 

Followers

Mathematica 教學:檔案複製、搬移

Chung-Yuan Dye 於 Saturday, February 4, 2012 1:45 PM 發表


最近寫一本講義,用到的圖檔實在太多,整理資料實在費時。所以就利用Mathematica來做一些資料搬移複製的工作。

(*檔案位置*)
path = NotebookDirectory[];
(*設定目錄位置*)
SetDirectory[path];
(*輸入LaTeX檔Compile後的log檔*)
test = Import["Ch1.log"];
(*抓出該TeX檔所使用的所有eps檔*)
epsdata=StringTrim@Flatten[StringCases[#,x__~~".eps Graphic file (type eps)"->x]&/@
Select[test,Length[#]==1&]]
(*新增一個資料夾CH1,將Ch1.tex所使用到的eps全部複製到Ch1*)
CreateDirectory["Ch1]
CopyFile[path<>#<>".eps", "path"<>"Ch1/"<>#<>".eps"]&/@epsdata
Tags: ,

讀者回應 ( 0 意見 )

Post a Comment

Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.

如果這篇文章對你有幫助,那請留個訊息給我~