Find file of particular pattern


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find file of particular pattern
# 1  
Old 08-05-2013
Find file of particular pattern

Hi All,

I have a file PSU_ 20130805_201308041234522

i want to search this file where variable day=20130805 and curday=20130804
after currday date some numbers will be added.how to search this file by using day and curday.

Thanks in advance.
# 2  
Old 08-05-2013
Please post example of your PSU file, how you like your output, and how to get this output.
# 3  
Old 08-05-2013
PSU files will be generated as per the values of day and currday when ever they change. I want a command, where by using the currday and day values i want to exactly search what is my PSU file currently.
Ex: PSU_82301_20130721_ 20130802185605
# 4  
Old 08-05-2013
Code:
find . -type f -name "PSU_*${day}_${curday}*"

. is the current work directory.
This User Gave Thanks to MadeInGermany For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to find pattern in file

Hi I am using awk to find the pattern from the file, but it is not displaying anything. Probably I am missing some syntax in expression. FILE xxxx.Merge.exchMon.BY.qTime 120 read xxxx.Merge.exchMon.BY.qStart 09:55 read... (9 Replies)
Discussion started by: sdosanjh
9 Replies

2. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

3. Shell Programming and Scripting

How to find and rename of particular pattern in file.?

Hi Guys, I have folder called /input/temp. Inside the folder I have lot of files. I need to find the file of pattern Article_????_test_?????????.txt and replace by format below. Article_????_?????????.txt Below is the one which I tried but it doesn't works can you please help us.... (4 Replies)
Discussion started by: Vinoth Kumar G
4 Replies

4. Shell Programming and Scripting

How to find a file with a specific pattern for current sysdate & upon find email the details?

I need assistance with following requirement, I am new to Unix. I want to do the following task but stuck with file creation date(sysdate) Following is the requirement I need to create a script that will read the abc/xyz/klm folder and look for *.err files for that day’s date and then send an... (4 Replies)
Discussion started by: PreetArul
4 Replies

5. Shell Programming and Scripting

how to find a pattern from an external file in a directory containing multiple file recursively

Hi, Need your help in this. I have an input file that has multiple enrollment_number, somewhat like 1234567 8901234 9856321 6732187 7623465 Now i have to search and delete these enrollment_number recursively from all the files that are within multiple sub-directories of a... (10 Replies)
Discussion started by: mukulverma2408
10 Replies

6. Shell Programming and Scripting

To find a pattern in file

Hi, I would like to find a pattern in a file as follows: I would like to find "or" "OR" "and" "AND" between two numeric values. I have tried this: grep '**or*' But does not work. Appreciate help on this. (4 Replies)
Discussion started by: pinnacle
4 Replies

7. Shell Programming and Scripting

Find a pattern in a file at a particular location

Hi all, I have a question on how to search for a pattern in a file and return a value if it is present at that particular location. How to read each line and each character for the pattern in the file of any format. Eg for the file format: attached the file (1 Reply)
Discussion started by: sparks
1 Replies

8. Shell Programming and Scripting

How to find this pattern in a file

hi all i have a file in my box, which is so huge and full file is in a single line. In this file i have to look for a pattern "ABC01234567" In this above mentioned pattern ABC is fixed and number might change . it will a eight digit random number Thanks so much for all you help ... (1 Reply)
Discussion started by: Prateek007
1 Replies

9. Programming

Find pattern in a file and erase it

Hello, I'd like to find pattern in a file and erase line containing that pattern and 2 lines below that pattern. I know how to find pattern with grep -r pattern and erase line containing that pattern, but can't figure out the rest, how to erase 2 lines below that pattern line. Any suggestions? ... (4 Replies)
Discussion started by: c0mrade
4 Replies
Login or Register to Ask a Question