priyasony has asked for the wisdom of the Perl Monks concerning the following question:
I need a specific word in a file name and file content should be pulled out from files among directory
I m new to perl . please help me!/usr/bin/perl -w my $directory = "/home/grds/datafiles"; opendir(DIR, $directory) or die "couldn't open $directory: $!\n"; @files = grep("EXP", readdir(DIR)); closedir(DIR); foreach $file (@files) { # print "$file\n"; open ($file }
example file name : EXPresult_3D0R0000002345_test345_cache1_IND0000ASD123_2014_04_12_18_56_12
I need 3D0R0000002345, test345, cache1, IND0000ASD123, 2014_04_12 should be stored in CSV file with separate columns.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I want specific word to be stored in a CSV file
by Laurent_R (Canon) on Jun 20, 2015 at 11:28 UTC | |
|
Re: I want specific word to be stored in a CSV file
by Anonymous Monk on Jun 20, 2015 at 07:39 UTC |