Wednesday, 15 July 2015

Perl Command Line Question


i'm trying automate process, running few problems.

have program running following command:

code:
./program -in file_001.txt -out file_001
where reading in in file, , outputting files end filename.

need around 90 different files (up file_088.txt).

i'm trying put perl script run them in command line, 1 @ time, incrementing filename reads in, , makes sure that equal out name.


code:
  for($f=1;$f<=88;f++){  './program -in file_0$f.txt -out file_0$f'  }  
something wrong, , i'm not sure how make sure 1,2,3,4,5,6,7,8,9 listed '01,02,...,09' make naming scheme work properly.


thanks!
 

this kind of thing quite easy shell script. there particular reason need/want use perl?

edit: if bash ok can start here:
code:
for file in *.txt; echo -in $file -out ${file%.*} ; done
b
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment