LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 12-02-2005, 11:40 PM   #1
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Rep: Reputation: 46
How to grep similar lines in bash?


I'm scripting the creation of an exif text file, with info from images. The problem is, I need to collect date info from very similar lines. See below:

bruno@frank:~/D70s/20051202$ cat eteste
File Modification Date/Time : 2005:11:25 23:09:40
Date/Time Of Last Modification : 2005:11:25 22:09:38
Date/Time Of Digitization : 2005:11:25 22:09:38
Shooting Date/Time : 2005:11:25 22:09:38
Shooting Date/Time : 2005:11:25 22:09:38.10

How do I pick the last line, which has fractions of seconds info?

thanks!
 
Old 12-02-2005, 11:55 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
How about something like this...
Code:
grep [.] file.txt
 
Old 12-03-2005, 12:56 AM   #3
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,509

Original Poster
Rep: Reputation: 46
I was doing
cat eteste|tail -n 1

your grep with regexp worked, as well. Thanks.

Its nice to have options.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script and grep syros Programming 4 01-13-2005 04:04 PM
bash command: grep mAineAc Programming 6 11-18-2004 12:00 PM
Can't get lines of a file with a Bash script.. barisdemiray Programming 2 08-11-2004 01:42 PM
complex command lines in bash? 3inone Linux - Newbie 1 04-20-2004 07:43 PM
Grep lines gsibble Linux - General 1 04-12-2004 02:30 AM


All times are GMT -5. The time now is 05:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration