Dear All,
I have written this code and it is working as follow,
1. Read the directory 2. Get all file name stored in @all_pdb_files array with .pdb extension
3. Print the information in and output.text file
opendir(DIR,"/home/Desktop/parser") or die "$!";
my @all_pdb_files = grep {/\.pdb$/} readdir DIR;
close DIR;
# Output file
open(OUTPUT,">output.txt");
foreach (@all_pdb_files){
print(OUTPUT "$_ \n");
}
But I need some more help to work on this script.
I want to retrive some particular information from each files. Here is Pseudo code for that I am not sure how to write the actual code.
opendir(DIR,"/home/Desktop/parser") or die "$!";
my @all_pdb_files = grep {/\.pdb$/} readdir DIR;
close DIR;
ForEach @all_pdb_files
1. Open and read each of these files
2. and Get/Match last word in the first line of each file
3. Store this last word from each file in a single file output.txt
Please help me in this regards
Regards
I have written this code and it is working as follow,
1. Read the directory 2. Get all file name stored in @all_pdb_files array with .pdb extension
3. Print the information in and output.text file
opendir(DIR,"/home/Desktop/parser") or die "$!";
my @all_pdb_files = grep {/\.pdb$/} readdir DIR;
close DIR;
# Output file
open(OUTPUT,">output.txt");
foreach (@all_pdb_files){
print(OUTPUT "$_ \n");
}
But I need some more help to work on this script.
I want to retrive some particular information from each files. Here is Pseudo code for that I am not sure how to write the actual code.
opendir(DIR,"/home/Desktop/parser") or die "$!";
my @all_pdb_files = grep {/\.pdb$/} readdir DIR;
close DIR;
ForEach @all_pdb_files
1. Open and read each of these files
2. and Get/Match last word in the first line of each file
3. Store this last word from each file in a single file output.txt
Please help me in this regards
Regards