LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-27-2011, 03:23 PM   #1
mskalak
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: Disabled
Using AWK to print out the first few lines of a txt file


Hi,

I have a few rather large text files, and I need a way to look at the first three lines of each. Is there a way to do this using awk?

Thanks!
 
Old 07-27-2011, 03:34 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi,

does it have to be awk? Normally you would use
head -n 3 file

to do this.
 
Old 07-27-2011, 03:52 PM   #3
mskalak
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks!
 
Old 07-27-2011, 03:58 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
You're welcome. Please mark the thread as solved.
 
  


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
[SOLVED] awk print only lines {not}containing FS grail Programming 8 04-12-2010 05:41 AM
Text file manipulation: selecting specific lines/columns using awk and print CHARL0TTE Linux - Newbie 2 02-27-2010 03:40 AM
awk print correct lines when certain columns are blank schneidz Programming 11 04-04-2008 05:06 PM
awk to remove first 3 lines and print remaining $1, $2 fields phyx Linux - General 1 01-10-2007 06:21 PM
awk print lines that doesn't have a pattern huynguye Programming 5 05-04-2006 12:08 PM


All times are GMT -5. The time now is 12:34 PM.

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