LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 10:40 PM   #1
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,513

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, 10:55 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

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

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



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 03:04 PM
bash command: grep mAineAc Programming 6 11-18-2004 11:00 AM
Can't get lines of a file with a Bash script.. barisdemiray Programming 2 08-11-2004 12:42 PM
complex command lines in bash? 3inone Linux - Newbie 1 04-20-2004 06:43 PM
Grep lines gsibble Linux - General 1 04-12-2004 01:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:38 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
Open Source Consulting | Domain Registration