Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How do you specific lines in a file? Post 81649 by Ygor on Tuesday 23rd of August 2005 12:04:43 AM
Old 08-23-2005
Try..
Code:
awk 'FNR>=20 && FNR<=40' file*

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting specific lines in a file

I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word. eg: line1 line2 line3 line4 line5 line6 "particular word"... I would like to delete line2-line6 and all such occurences in that... (4 Replies)
Discussion started by: ramu_1980
4 Replies

2. Shell Programming and Scripting

remove specific lines from a file

Hi there I have a file with a variable amount of rows but the 45th, 46th and 47th charachter of each line is the status field which is a three digit code ie 001, 002, 003 etc. My question is this..I need to strip all the records/lines with 002's out of the file completely and put them into... (14 Replies)
Discussion started by: hcclnoodles
14 Replies

3. Shell Programming and Scripting

how to remove specific lines from a file

When restoring a file in my uninstall program I need to remove the lines I added to a file during the install. In between the file can be modified by the users. Assume file1 is as follow: xxx str2 xxxx ..... ...The Following lines containing str* have to be removed... xxx str1 xxxx xxx ... (17 Replies)
Discussion started by: bluemoon1
17 Replies

4. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

5. Shell Programming and Scripting

Substitute specific lines with lines from another file

Hello All, I am new to this forum. I am currently facing a problem in manipulating files. I have two files called old-matter and new-matter # cat old-matter abc: this, is a, sample, entry byi: white board, is white in color rtz: black, board is black qty: i tried, a lot asd: no... (1 Reply)
Discussion started by: rahmathulla
1 Replies

6. Shell Programming and Scripting

Cutting specific lines from a file

Hi, I have a file named Mani.txt. The contents are like this cat Mani.txt -------------------------------------------------------- Hi there how r u My Name is Mani Bye ------------------------------------------------------------ I want to cut the first and last lines from the file... (15 Replies)
Discussion started by: pathanjalireddy
15 Replies

7. Shell Programming and Scripting

Extract specific lines from a file

Hi, I have a file which contains DDL statements- CREATE TABLE, CREATE INDEX, ALTER TABLE etc. I have to only pick CREATE TABLE statements from the file- Source : ---------------------------------------------- --DDL for table abc -------------------------------------------- CREATE TABLE... (4 Replies)
Discussion started by: newb
4 Replies

8. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

9. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

10. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgawk | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for gawk is available on http://opensolaris.org. Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 02:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy