LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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,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, 10: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-02-2005, 11:56 PM   #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 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


All times are GMT -5. The time now is 09:12 AM.

Main Menu
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