Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. $ tree
  2. .
  3. ├── Original_folder
  4. │ └── cat.txt
  5. ├── folderCD
  6. │ └── cat.txt
  7. ├── folderGK
  8. │ └── cat.txt
  9. ├── folderFE
  10. └── cat.txt
  11.  
  12. Version LRv1.10.0
  13. Build date 2017-12-06
  14. MOL-calc
  15. PRESSURE
  16. !
  17. Time[s] InletT[K] InletP[Pa] O2_GasOut C_GasOut
  18. 100 0.000885 1000000 0.0007 0.2111
  19. and so on....
  20.  
  21. #!/bin/bash
  22.  
  23. gawk -F $'t' ' # Using TABs as field separators
  24. /_GasOut/{ # On lines containing "_GasOut"
  25. for(f=1;f<=NF;f++){ # ... iterate over all fields on line
  26. this=$f # ... picking them up
  27. if(index(this,"_GasOut"))wanted[f]=1 # ... and noting which ones we want to print
  28. }
  29. }
  30. ENDFILE{ # As we reaach end of each file
  31. for(f in wanted){ # ... iterate over wanted fields
  32. if(length(cmds)) cmds = cmds ",n" # ... adding commas and newlines if needed
  33. cmds = cmds """ FILENAME "" using 1:" f # ... and adding the "using" statement
  34. }
  35. delete wanted # Forget list of wanted fields for next file
  36. }
  37. END{ # At very end of last file
  38. print cmds # ... print accumulated gnuplot cmds
  39. }
  40.  
  41. ' folder*/cat.txt
  42.  
  43. (Original_folder)
  44. "Original_folder/cat.txt" using 1:22,
  45. "Original_folder/cat.txt" using 1:23,
  46. "Original_folder/cat.txt" using 1:24,
  47. "Original_folder/cat.txt" using 1:25,
  48. "Original_folder/cat.txt" using 1:26,
  49. "Original_folder/cat.txt" using 1:27,
  50. "Original_folder/cat.txt" using 1:28,
  51.  
  52. (Other folders)
  53. "folderCD/cat.txt" using 1:22,
  54. "folderCD/cat.txt" using 1:23,
  55. "folderCD/cat.txt" using 1:24,
  56. "folderCD/cat.txt" using 1:25,
  57. "folderCD/cat.txt" using 1:26,
  58. "folderCD/cat.txt" using 1:27,
  59. "folderCD/cat.txt" using 1:28,
  60. "folderGK/cat.txt" using 1:22,
  61. "folderGK/cat.txt" using 1:23,
  62. "folderGK/cat.txt" using 1:24,
  63. "folderGK/cat.txt" using 1:25,
  64. "folderGK/cat.txt" using 1:26,
  65. "folderGK/cat.txt" using 1:27,
  66. "folderGK/cat.txt" using 1:28
  67.  
  68. gnuplot>plot "Original_folder/cat.txt" using 1:22,
  69. "folderCD/cat.txt" using 1:22
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement