Skip to content

Latest commit

 

History

History
786 lines (725 loc) · 37.7 KB

myWork25.org

File metadata and controls

786 lines (725 loc) · 37.7 KB

25° Yaw Angle

1. Backup test

pwd
ls sphere*.cas|awk -F"-" 'BEGIN{i=1}{print substr($5,0,length($5)-4),",",i; i=i+1}'

1.1 Backup

      pwd
  #  ls *.cas|awk -F"-" '{print $5}'
#  ls sphere*.cas|awk -F"-" 'BEGIN{i=1}{print substr($5,0,length($5)-8),",",i; i=i+1}'
# 
ls sphere*.cas|awk -F"-" 'BEGIN{i=1;prefix="sphere12-14-15-1.csv";}{print substr($5,0,length($5)-4),",",i >prefix; i=i+1}' 

2. Rename test

cas

ls *.cas|awk -F"-" 'BEGIN{i=1;prefix="sphere12-14-15-1-";postfix=".cas"}
  {originalFile=prefix""substr($5,0,length($5)-4);cmd="rename "originalFile" "sprintf("%03d",i)" "originalFile""postfix;i=i+1;print(cmd);}'

data

一定要重视测试,现在测试明眼一看就有问题!!!!!!

ls *.dat|awk -F"-" 'BEGIN{i=1;prefix="sphere12-14-15-1-";postfix=".dat"}
  {originalFile=prefix""substr($5,0,length($5)-4);cmd="rename "originalFile" "i" "originalFile""postfix;i=i+1;print(cmd);}'

rename第二列是要替换的表达式 第三列是要替换的形式(缩列形式) 第四列是文件名

2.1 Rename

cas

ls *.cas|awk -F"-" 'BEGIN{i=1;prefix="sphere12-14-15-1-";postfix=".cas"}
  {originalFile=prefix""substr($5,0,length($5)-4);cmd="rename "originalFile" "i" "originalFile""postfix;i=i+1;system(cmd);}'

dat

ls *.dat|awk -F"-" 'BEGIN{i=1;prefix="sphere12-14-15-1-";postfix=".dat"}
  {originalFile=prefix""substr($5,0,length($5)-4);cmd="rename "originalFile" "i" "originalFile""postfix;i=i+1;system(cmd);}'

开始进行tecplot处理

tecplot

需要把tecplot路径放到path中! 事先录制好脚本,安排好文件名字!

tec360.exe fluent17.mcr

3. Recovery Tests

  cat sphere*.csv|awk -F, 'BEGIN{prefix="sphere12-14-15-1-";postfix=".cas"}
{output=prefix""substr($1,0,length($1)-1)""postfix;input=sprintf("%03d",$2)""postfix;cmd="rename "input" "output" "input;print cmd;}'

3.1 Recovery

cas

  cat sphere*.csv|awk -F, 'BEGIN{prefix="sphere12-14-15-1-";postfix=".cas"}
{output=prefix""substr($1,0,length($1)-1)""postfix;input=sprintf("%03d",$2)""postfix;cmd="rename "input" "output" "input;system(cmd);}'

dat

  cat sphere*.csv|awk -F, 'BEGIN{prefix="sphere12-14-15-1-";postfix=".dat"}
{output=prefix""substr($1,0,length($1)-1)""postfix;input=sprintf("%03d",$2)""postfix;cmd="rename "input" "output" "input;system(cmd);}'