P
Peter Bailey
Why is it that File.basename works for me for one single file, but, it
doesn't work for an array of files. Here's an example of what worked for
me for one file; then, it didn't work for multiple files.
Thanks,
Peter
file = "va998.tif"
pdffile = File.basename(file, ".tif") + ".pdf"
puts "#{file} #{pdffile}"
yields:
va998.tif va998.pdf
Dir.glob("*.tif").each do |tiffile|
pdffile = File.basename(tiffile, ".tif") + ".pdf"
puts "#{tiffile} #{pdffile}"
end
yields:
va992.tif va992.tif.pdf
va993.tif va993.tif.pdf
va994.tif va994.tif.pdf
...
doesn't work for an array of files. Here's an example of what worked for
me for one file; then, it didn't work for multiple files.
Thanks,
Peter
file = "va998.tif"
pdffile = File.basename(file, ".tif") + ".pdf"
puts "#{file} #{pdffile}"
yields:
va998.tif va998.pdf
Dir.glob("*.tif").each do |tiffile|
pdffile = File.basename(tiffile, ".tif") + ".pdf"
puts "#{tiffile} #{pdffile}"
end
yields:
va992.tif va992.tif.pdf
va993.tif va993.tif.pdf
va994.tif va994.tif.pdf
...