Pick out the various extension file from log of the same date


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pick out the various extension file from log of the same date
# 1  
Old 11-01-2010
Pick out the various extension file from log of the same date

extension file from log

Last edited by NehaKrish; 11-01-2010 at 05:55 AM..
# 2  
Old 11-01-2010
If I've understood your question correctly then "basename" might help you.
Unix Tip: Stripping file extensions with the basename command | ITworld

if it's the other way you want. try
Code:
file=”somefile.ext”
echo “filename: ${file%.*}”
echo “extension: ${file#*.}”


Last edited by cue; 11-01-2010 at 05:38 AM..
# 3  
Old 11-01-2010
I need to check those extension files from the log daily(i.e for the current date) and should send those etxension names to a textfile/flatfile.
# 4  
Old 11-01-2010
I'm sorry. Perhaps I don't understand the question. so you have a log file for a given date, today. You want your output to be all files that have the extension (dat,errdat,ctl)? Can't you just use a simple yet crude method like grep?

Last edited by cue; 11-01-2010 at 06:07 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to pick the latest file with date as one among the file name.( not exactly present date.)?

i have files like 1)20131112_abc_01.csv and 2)20131113_abc_01.csv and 3)20131113_abc_02.csv when i try to fetch the file in the next day. it shud pick the third file.. plz help me.. and i use `date +"%Y%m%d"` command to fetch..it fetches the current date... (2 Replies)
Discussion started by: applepie
2 Replies

2. Shell Programming and Scripting

Pick the last one hour lines from log matching this pattern.

Hello please help me on this, pick the last one hour lines from the log, which have the prefix time format like this. log message log message i tried to do grep, but that failed. my code grep '(date +)' log_file_path This checking only the current time stamp. How to get the log... (16 Replies)
Discussion started by: santosh2626
16 Replies

3. Shell Programming and Scripting

Need help to pick the content from Log file

Hi All, Below is my requirement. I need to pick the certain content from log file and display. for example log file consist of following information project1 project2 project3 filename1, size1, ower1, datecreated filename2, size2, ower2, datecreated filename3, size3, ower3,... (6 Replies)
Discussion started by: bbc17484
6 Replies

4. Shell Programming and Scripting

Script pick elements according to the date in file

Hello, i am having file details having elements mentioned below Asia jan 18 Europe Jan 19 America Jan 20 I made script but it picks all the elements, i want to pick the elements according to the date to run the script i made cron job. Please advise how it can work.... (12 Replies)
Discussion started by: rajjev_saini123
12 Replies

5. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

6. Shell Programming and Scripting

Delete log file entries based on the Date/Timestamp within log file

If a log file is in the following format 28-Jul-10 ::: Log message 28-Jul-10 ::: Log message 29-Jul-10 ::: Log message 30-Jul-10 ::: Log message 31-Jul-10 ::: Log message 31-Jul-10 ::: Log message 1-Aug-10 ::: Log message 1-Aug-10 ::: Log message 2-Aug-10 ::: Log message 2-Aug-10 :::... (3 Replies)
Discussion started by: vikram3.r
3 Replies

7. Shell Programming and Scripting

Date before file extension

hi i nned help in moving a file with the date before the file extension for example mv xxxxx.pdf xxxxx16042010.pdf i tried mv xxxxx.pdf xxxxx`date +'%m%d%y'`.pdf did not work any help appriciated (1 Reply)
Discussion started by: antointoronto
1 Replies

8. Shell Programming and Scripting

how can i pick the latest log file as per below

in the below .. i want to pick the latest logfile which is having JPS.PR inside.. that means i want particularly "spgport040408041223.log:@@@@@@@@ 04:13:09 Adding: JPS.PR." which is latest among these.. is it possible to compare the current time with logfile time ? reptm@xblr0758rop>... (4 Replies)
Discussion started by: mail2sant
4 Replies

9. Shell Programming and Scripting

Processing a log file based on date/time input and the date/time on the log file

Hi, I'm trying to accomplish the following and would like some suggestions or possible bash script examples that may work I have a directory that has a list of log files that's periodically dumped from a script that is crontab that are rotated 4 generations. There will be a time stamp that is... (4 Replies)
Discussion started by: primp
4 Replies

10. Shell Programming and Scripting

Sort files by Date-timestamps available in filename & pick the sortedfiles one by one

Hi, I am new to Unix shell scripting. Can you please help me with this immediate requirement to code.. The requirement is as given below. In a directory say Y, I have files like this. PP_100000_28062006_122731_746.dat PP_100000_28062006_122731_745.dat PP_100000_28062006_122734_745.dat... (4 Replies)
Discussion started by: Chindhu
4 Replies
Login or Register to Ask a Question