
ab2388
New User
Nov 16, 2010, 9:53 AM
Post #1 of 2
(718 views)
|
Retrieving information from files
|
Can't Post
|
|
Hi, I have a list of .ksh files in a text file (txtfile.txt): file1.ksh file2.ksh file3.ksh The .ksh files contain paths of other files with the following extensions: .txt, .dat. What I would like to do is parse through all the .ksh files contained in the text file (txtfile.txt) and retrieve the paths and filenames for all the files inside the .ksh files that have extensions .txt and .dat. So far I have:
# open file open(FILE, "kshfiles.txt") or die("Unable to open file"); # read file into an array my @kshNames = <FILE>; foreach (@kshNames) { open(kshFile, $_); ... } # close file close(FILE); I guess I am not sure how to go about retrieving the paths and filenames of .txt and .dat files inside of the .ksh files. Any ideas? Thanks!
|