Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on. Post 303039971 by Sagar Singh on Saturday 19th of October 2019 04:51:45 PM
Old 10-19-2019
Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.................150



Output needed:
Code:
1
10
11
20
21
30
..
..
..

141
150

Moderator's Comments:
Mod Comment Please wrap your samples in CODE TAGS as per forum rules.

Last edited by RavinderSingh13; 10-20-2019 at 05:14 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find pattern delete line with pattern and line above and line below

I have a file that will sometimes contain a pattern. The pattern is this: W/D FRM CHK 00 I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (1 Reply)
Discussion started by: nickg
1 Replies

2. Shell Programming and Scripting

find pattern, delete line with pattern and line above and line below

I have a file that will sometimes contain a pattern. The pattern is this: FRM CHK 0000 I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (4 Replies)
Discussion started by: nickg
4 Replies

3. Shell Programming and Scripting

Grep multiple line pattern and output the lines

Hi I have the following Input -- -- TABLE: BUSINESS_UNIT -- ALTER TABLE RATINGS.BUSINESS_UNIT ADD CONSTRAINT FK1_BUSINESS_UNIT FOREIGN KEY (PEOPLESOFT_CHART_FIELD_VALUE_ID) REFERENCES RATINGS.PEOPLESOFT_CHART_FIELD_VALUE(PEOPLESOFT_CHART_FIELD_VALUE_ID) ; ALTER TABLE... (1 Reply)
Discussion started by: pukars4u
1 Replies

4. Shell Programming and Scripting

bash: read file line by line (lines have '\0') - not full line has read???

I am using the while-loop to read a file. The file has lines with null-terminated strings (words, actually.) What I have by that reading - just a first word up to '\0'! I need to have whole string up to 'new line' - (LF, 10#10, 16#A) What I am doing wrong? #make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies

5. Shell Programming and Scripting

how to read the contents of two files line by line and compare the line by line?

Hi All, I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies

6. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

7. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

8. Shell Programming and Scripting

How to read file line by line and compare subset of 1st line with 2nd?

Hi all, I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like: <date1>|<data1>|<url1>|<result1> <date2>|<data2>|<url2>|<result2> <date3>|<data3>|<url3>|<result3> <date4>|<data4>|<url4>|<result4> What I... (3 Replies)
Discussion started by: pat_pramod
3 Replies

9. Shell Programming and Scripting

awk to combine lines from line with pattern match to a line that ends in a pattern

I am trying to combine lines with these conditions: 1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text. 2. If condition1 is met then continue to combine lines through a line that ends with a semicolon. 3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
5 Replies

10. UNIX for Beginners Questions & Answers

Reading a file line by line and print required lines based on pattern

Hi All, i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field. i am using centos 7 Operating system. want to read below file. # cat /tmp/d5 NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
TM::Axes(3pm)						User Contributed Perl Documentation					     TM::Axes(3pm)

NAME
TM::Axes - Topic Maps, Axes for TM::match* DESCRIPTION
The TM module offers the method "match" (and friends) to query assertions in a TM data structure. While there is a generic search specification, it will be too slow. Instead some axes have been implemented specifically. These are listed below. SEARCH SPECIFICATIONS
Automatically generated from TM (1.54) Code:<empty> returns all assertions Code:anyid return all assertions where a given toplet appears somehow 'anyid' => 'the toplet' Code:aplayer.arole.bplayer.brole.type return all assertions of a given type where a given toplet plays a given role and there exist another given role with another given toplet as player 'bplayer' => 'the player for the brole', 'aplayer' => 'the player toplet for the arole', 'arole' => 'the role toplet (incl subclasses) for the aplayer', 'type' => 'the type of the assertion', 'brole' => 'the other role toplet (incl subclasses)' Code:aplayer.arole.brole.type return all assertions of a given type where a given toplet plays a given role and there exist another given role 'aplayer' => 'the player toplet for the arole', 'arole' => 'the role toplet (incl subclasses) for the aplayer', 'type' => 'the type of the assertion', 'brole' => 'the other role toplet (incl subclasses)' Code:char.irole deprecated: return all assertions which are characteristics for a given toplet 'irole' => 'the toplet for which characteristics are sought', 'char' => '1' Code:char.topic return all assertions which are characteristics for a given toplet 'topic' => 'the toplet for which characteristics are sought', 'char' => '1' Code:char.topic.type return all assertions which are a characteristic of a given type for a given topic 'topic' => 'the toplet for which these characteristics are sought', 'char' => '1', 'type' => 'type of characteristic' Code:char.type return all assertions which are characteristics for some given type 'char' => '1', 'type' => 'the characteristic type' Code:char.type.value return all assertions which are characteristics for some topic of a given value for some given type 'value' => 'the value for which all characteristics are sought', 'char' => '1', 'type' => 'the characteristic type' Code:char.value return all assertions which are characteristics for some topic of a given value 'value' => 'the value for which all characteristics are sought', 'char' => '1' Code:class.type returns all assertions where there are instances of a given toplet 'class' => 'which toplet should be the class', 'type' => 'isa' Code:instance.type returns all assertions where there are classes of a given toplet 'type' => 'isa', 'instance' => 'which toplet should be the instance' Code:iplayer return all assertions where a given toplet is a player 'iplayer' => 'the player toplet' Code:iplayer.irole return all assertions where a given toplet is a player of a given role 'iplayer' => 'the player toplet', 'irole' => 'the role toplet (incl subclasses)' Code:iplayer.irole.type return all assertions of a given type where a given toplet is a player of a given role 'iplayer' => 'the player toplet', 'irole' => 'the role toplet (incl subclasses)', 'type' => 'the type of the assertion' Code:iplayer.type return all assertions of a given type where a given toplet is a player 'iplayer' => 'the player toplet', 'type' => 'the type of the assertion' Code:irole return all assertions where there is a given role 'irole' => 'the role toplet (incl subclasses)' Code:irole.type return all assertions of a given type where there is a given role 'irole' => 'the role toplet (incl subclasses)', 'type' => 'the type of the assertion' Code:lid return one particular assertions with a given ID 'lid' => 'the ID of the assertion' Code:nochar returns all associations (so no names or occurrences) 'nochar' => '1' Code:subclass.type returns all assertions where there are subclasses of a given toplet 'subclass' => 'which toplet should be the superclass', 'type' => 'is-subclass-of' Code:superclass.type returns all assertions where there are superclasses of a given toplet 'superclass' => 'which toplet should be the subclass', 'type' => 'is-subclass-of' Code:type return all assertions with a given type 'type' => 'the type of the assertion' SEE ALSO
TM COPYRIGHT AND LICENSE
Copyright 200[8] by Robert Barta, <drrho@cpan.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-06-20 TM::Axes(3pm)
All times are GMT -4. The time now is 11:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy