I have a directory named Project.I have a control file which contains valid list of files.I would like list the files from directory Project which contains files other than listed in the control file.
Sample control file:
TEST
SEND
SFFFILE
CONTL
The directory contains followign files:
TEST
SEND
SFFFILE
CONTL
Link
seq
test
param
When i run a script it has to create a file with the following files.
Link
seq
test
param
Please give me any suggestion how to do this .Control file contains more file and dir also contains more file.Please tell the efficient way to do this.
Trivially, take out the -x option which requires the whole line to match, and add an -i option to make matching ignore case. However, that does not anchor searches to beginning of line, so e.g. a file named bestest will match the pattern test. Maybe you could accept a change to the control file format, to support full regular expressions? Then the control file should contain
It's possible to come up with a different workaround if this is not acceptable. If your needs are very specific, perhaps a small awk script would be best.
(With this script, you should keep the original control file.)
Last edited by era; 08-15-2008 at 03:44 AM..
Reason: Oops, mixing Perl and awk syntax
Your requirements are not clear; need to be precise about them or it all gets lost in translation...and please use code tags.
The entries in the control file should match only the name of the file but not the extension...correct??
Hii,
Could someone help me to append string to the starting of all the filenames inside a directory but it should exclude .zip files and subdirectories.
Eg.
file1: test1.log
file2: test2.log
file3 test.zip
After running the script
file1: string_test1.log
file2: string_test2.log
file3:... (4 Replies)
Hi,
I want to display the file names and the record count for the files in the 2nd column for the files created today.
i have written the below command which is listing the file names. but while piping the above command to the wc -l command
its not working for me.
ls -l... (5 Replies)
Find all files in the current directory only excluding hidden directories and files.
For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided.
`find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Hi,
I have a folder which contains files in this format.
abc-bin.000001
abc-bin.000002
abc-bin.000003
abc-bin.000004
abc-bin.000005
abc-bin.000006
abc-bin.000007
abc-bin.000008
abc-bin.000009
abc-bin.000010
abc-bin.index
I want to copy all the files between
abc-bin.000004... (6 Replies)
I am running Ubuntu 11.10
I have the following files.
geo2503r05690585.html
geo2503r06020612.html
geo2503r06250641.html
geo2503r06490658.html
geo2503r06830686.html
geo2503r05860601.html
geo2503r06130624.html
geo2503r06420648.html
geo2503r06590682.html ... (4 Replies)
HI All,
At present in my server the log folder was filled up and causing memory issue.
So I am planning to write a script in such a way that the files which are older than 30 days will be deleted and also need to find the files which were not compressed and need to compress this file.... (4 Replies)
Hi,
Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time..
Thanks (3 Replies)
Hi,
I am new to perl:
I need to write perl script to list all the files present in directory and mail should be come to my inbox with all the files present in that directory.
advanced thanks for valuable inputs.
Thanks
Prakash GR (1 Reply)
Hi All,
I need a solution on my following find command
find ./.. -name '*.file' -print
BTW This gives me the output as belows
./rtlsim/test/ADCONV0/infile/ad0_dagctst.file
./rtlsim/test/ADCONV0/user_command.file
./rtlsim/test/ADCONV0/simv.daidir/scsim.db.dir/scsim.db.file... (2 Replies)
Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories.
The following command also shows the files but I only want to see the directories.
ls -lrtR * (4 Replies)