Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-04-2006, 04:10 PM   #1
LQ Newbie
Registered: Sep 2004
Posts: 11

Rep: Reputation: 0
Tricky grep question

I'm trying to return the lines from a file that contain a comma in any of the first 9 characters. Any other characters are fine, as long as there's a comma somewhere in the first 9 characters. This needs to run from a commandline. Any suggestions?
Old 01-04-2006, 05:16 PM   #2
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
How about
grep "^.\{0,8\}," myfile


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
Xorg tricky question festino114 Linux - General 4 06-29-2005 03:51 PM
Tricky installation question or1onas Linux - Newbie 3 04-28-2004 05:16 PM
a tricky question archlyric Linux - Newbie 3 02-27-2004 02:06 AM
Tricky Konqueror Question gbrad Linux - General 2 03-02-2003 06:32 PM
A Tricky question in Apache!! RKris Linux - Software 1 02-20-2003 09:19 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:17 AM.

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