Visit The New, Modern Unix Linux Community


Advance file_name serech from set of list files in particular directory


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Advance file_name serech from set of list files in particular directory
# 1  
Advance file_name serech from set of list files in particular directory

Hi All,

im hav one requirement, let me explain my requirement.
my script will run every one hour and it wil pull files from remote server to my local server.but the d files hwich are pulled my not be in required format wht im expecting in my server.
but in my sever in particular dierectory i wil hav a set of list files, like acd.txt,zyx.dat,...
in which abc.txt will hav all the .txt extensin files in that list files.same as the others list files.

but the probles is file names will not be static...the file name which are pulled will hav some time stamp appending in d end to the file name but in the list files it wont have that time stamp in that list files.

some sample files which i pulled:
KI.P.PYM.NDM.MCSNGLCO.CYCJ003.201212.dat.gz
BADKI.P.PYM.NDM.MCSNGLVW.CYCJ002.201206.dat.gz
KI.P.PYM.NDM.MCSNGLVW.CYCJ002.201210.dat.gz
PX.P.D15.PXLV3015.VZ450.201210.adt
PX.P.D20.PXLV3020.VZ450.201212.adt
VGWNY0PN.FTP.MCIXP31A.SHIP.J12335.AUDITSUM

but in the list files it will be:
OV_GOLDMINE_BTN_*.txt
VZDWH_Opportunity_*.txt.gz
VZDWH_Event*.txt
ez_pipeline_VZT_D_*.txt.gz
sopl_*.txt

and finally we hav to see the pulled file is of required format or not i.e, it is ziped or unzip files
according to list file name we hav to do that to.

Any help with this would be greatly appreciated.
# 2  
So how is this "list files" is formed or created?

It looks like those are the master files which would select the files that were pulled by ur another script!

Do explain clearly! SmilieSmilie
# 3  
Quote:
Originally Posted by PikK45
. . .
Do explain clearly! SmilieSmilie
Yes please! I don't see any connection between your set of files and your list, and, on top, it's very hard to understand what you request.
# 4  
the list files which i am talking about it wil be fixed.
the list files wil be configured and it wont change
# 5  
Let me explain...

> you have a file named "files.list" (changed for better understanding)
> you pull several files every hour from a remote server to your local
> you don't want the files that are not in the format listed in "files.list"

correct???

Answer these:
1. You know the format of files that you need. Then why are you pulling other files as well?
2. So after identifying the unnecessary files what are you planning to do about them?
# 6  
> you have a file named "files.list" (changed for better understanding)
no their wil be many list file based on type of file in one directory
> you pull several files every hour from a remote server to your local
ya script wil pull server files and we hav to check those files across this list files
> you don't want the files that are not in the format listed in "files.list"
ya i want those files

1. You know the format of files that you need. Then why are you pulling other files as well?
no i dont know the format of files,i simple pull files which are present in that remote dir to my dir.
2. So after identifying the unnecessary files what are you planning to do about them?
i want those files

---------- Post updated at 12:47 PM ---------- Previous update was at 12:42 PM ----------

i hav to compare the pulled file name against the list files available in the directory.
but i told previously in d post
file names are not static so how to search the file names in the list files?
please help
# 7  
Ok... Here we go again Smilie

Quote:
i hav to compare the pulled file name against the list files available in the directory
Just explain on this one!!

Lets consider you download 10 files from the remote directory namely

Code:
1.txt
2.xls
3.csv
4.txt
5.dat.gz
6.dat
7.Z
8.log
9.c
10.doc

Now tell me how your list files would look like and what do you want to do with these files.

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #806
Difficulty: Medium
The decimal value 10,995 is expressed in hexadecimal as 2AF5
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

2. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies

3. UNIX for Advanced & Expert Users

Find the list of files with a set of Users

Hello all, I want to find the files for certain users. I cant make the or condition work in this instance. I've tried the code below but it didnt worked. Any input on how to get the list for all files for this users. find . -type f -user abc134 -o -user xyz345 -o bce483 -exec ls... (6 Replies)
Discussion started by: sethmj
6 Replies

4. Shell Programming and Scripting

Need to delete large set of files (i.e) close to 100K from a directory based on the input file

Hi all, I need a script to delete a large set of files from a directory under / based on an input file and want to redirect errors into separate file. I have already prepared a list of files in the input file. Kndly help me. Thanks, Prash (36 Replies)
Discussion started by: prash358
36 Replies

5. Shell Programming and Scripting

Copy list of files from a keyword list to another directory

Hello, I have a folder with a massive amount of files, and I want to copy out a specific subset of the files to a new directory. I would like to use a text file with the filenames listed, but can't get it to work. The thing I'm hung up on is that the folder names in the path can and do have... (5 Replies)
Discussion started by: twjolson
5 Replies

6. UNIX for Dummies Questions & Answers

How to get the set of files size as a sum in a directory.

Hi, Can someone help me to get the complete files size (sum) over a perod time (1 day,2days)in a directory. eg: Directory :ABC I have a1,a2,a3 files are created in last 24 hours so I need to get the some of all these files. I am using the below find command but its giving me the... (1 Reply)
Discussion started by: gaddamja
1 Replies

7. Shell Programming and Scripting

find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following: I have a list of filenames: A01_155716 A05_155780 A07_155812 A09_155844 A11_155876 that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies

8. Shell Programming and Scripting

spilit the list of files in set ls -1 *.dbf

Dear All, Please help in this subject.. my requirement is list the files in directory and out of that list make the different set and each should set contains 10 files and assign to variable and start zipping in background. pick the second set files and same to be repeat the commands parallel. i... (3 Replies)
Discussion started by: nmadhuhb
3 Replies

9. Shell Programming and Scripting

Sheel script to Delete a set of files from a given directory

I have a file <filestodelete> containing names of files to to be deleted from a directory <filesstore>. I want a script file which accptes the <filestodelete> and also the location of the directory(<filestore>) and deletes all files matching. Thanks in Advance.. (3 Replies)
Discussion started by: VardhiniVenkat
3 Replies

10. Shell Programming and Scripting

How to sort a set of files by date in a directory?

hi there, I have a directory which contents I can parse dynamically. I end up with a file list. I then want to display those files sorted by date, oldest files first. I have very very little PERL experience...Would anyone know how to do that ? Thanks in advance. (8 Replies)
Discussion started by: alexf
8 Replies

Featured Tech Videos