Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Reading specific part of file Post 76712 by guptan on Thursday 30th of June 2005 04:55:11 AM
Old 06-30-2005
Reading specific part of file

I have a requirement to go to particular line in the file and from there read the contents till it meets a particular criteria. For eg if the contents of the file is like

81 abcd ------------------- Line 1
82 cdfe ------------------- Line 2
83 dfj ------------------- Line 3
84 df ------------------- Line 4
81 dkfh ------------------- Line 5
82 df ------------------- Line 6
83 dlf ------------------- Line 7
84 dif ------------------- Line 8
81 sdfh ------------------- Line 9
82 dfjh ------------------- Line 10
83 kdf ------------------- Line 11
84 dfj ------------------- Line 12

What the program should do is go to line number 5 directly and from there read the contents of the file till it finds the line starting with 81 again.

TIA
Narayana Gupta
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading specific line from file

Hi all... I not a expert unix script programmer, Kindly adjust. My requirement is that, i have a file which contains the about 10 lines - say 1 2 3 ... 8 war of the worlds: => text in this line 9 9000,80,78,77,334,445 => this line contains some numbers separted by commas 10 ... (10 Replies)
Discussion started by: cool_boss2121
10 Replies

2. Shell Programming and Scripting

Reading data from a specific line in a text file

hello, I have got the following problem that I am hoping someone can help with please. 1. I have got the following text file (below) , the columns data are 'Test Day', 'Board', 'Betting Number'. TEXT FILE ============================================ 1 3 02-01-27-28-29-30 0 1... (1 Reply)
Discussion started by: jermaine4ever
1 Replies

3. Shell Programming and Scripting

Reading data from a specific line in a text file

Hello, I have a problem which is giving me headache for days, can some please help. Please see code and text fiel below. Please see text in red for the problem I am facing # Program gets an input x from user while read line ; do echo... (4 Replies)
Discussion started by: jermaine4ever
4 Replies

4. UNIX and Linux Applications

Reading a file for specific words

Hi I have a script where the user calls it with arguments like so: ./import.sh -s DNSNAME -d DBNAME I want to check that the database entered is valid by going through a passwd.ds file and checking if the database exists there. If it doesn't, the I need to send a message to my log... (4 Replies)
Discussion started by: ladyAnne
4 Replies

5. UNIX for Dummies Questions & Answers

Reading a specific line from a file

Hi All, I am having 100 lines a text file say a.txt. I want read the 'nth' line from that file inside a script. Kindly tell us how to that. (2 Replies)
Discussion started by: boopathyvasagam
2 Replies

6. Shell Programming and Scripting

Help with reading a specific portion of a file using PERL

Hello, I am trying to read from a file using PERL:confused, however i need to read specific portions of the file the file goes like this <Name 1 Hono <Name 2 Jack and so on anyways i need to be able to write a program that ONLY opens the lines beginning with "<"? so it would... (2 Replies)
Discussion started by: UNDstudent
2 Replies

7. UNIX for Dummies Questions & Answers

Reading specific lines from a file using index or keywords

Hello I want to read from a file which contains email addresses. The file format is like this. from@mail.com to1@mail.com to2@mail.com cc@mail.com bcc@mail.com I'll have to read from such file and assign the email addresses to respective variables. frommail =... (11 Replies)
Discussion started by: Kyaw Lwin Phyo
11 Replies

8. Shell Programming and Scripting

[Solved] Printing a part of the last line of the specific part of a file

Hi, I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this: Name =A xxxxxx yyyyyy zzzzzz aaaaaa bbbbbb Value = 57 This is necessary because in a file there are written more lines which... (6 Replies)
Discussion started by: wenclu
6 Replies

9. Shell Programming and Scripting

Reading specific range of columns in an Excel file

Hi All, I want to read an excel file. PFA excel, I want to read the cloumn from A to G and the V to AH starting from Row number 3. Please help me on this. (7 Replies)
Discussion started by: Abhisrajput
7 Replies

10. Shell Programming and Scripting

How to print the specific part of the file name with file creation date?

Hello Folks, I have an requirement, where i need to get total count of the file based on creation date with there filename selected pattern. Filename: MobileProtocol.20171228T154200.157115.udr I want to get the count of files created on each day based on a pattern find. find . -type... (7 Replies)
Discussion started by: sadique.manzar
7 Replies
MODULI(5)						      BSD File Formats Manual							 MODULI(5)

NAME
moduli -- system moduli file DESCRIPTION
The /etc/moduli file contains the system-wide Diffie-Hellman prime moduli for sshd(8). Each line in this file contains the following fields: Time, Type, Tests, Tries, Size, Generator, Modulus. The fields are separated by white space (tab or blank). Time: yyyymmddhhmmss. Specifies the system time that the line was appended to the file. The value 00000000000000 means unknown (historic). Type: decimal. Specifies the internal structure of the prime modulus. 0: unknown; often learned from peer during protocol operation, and saved for later analysis. 1: unstructured; a common large number. 2: safe (p = 2q + 1); meets basic structural requirements. 3: Schnorr. 4: Sophie-Germaine (q = (p-1)/2); usually generated in the process of testing safe or strong primes. 5: strong; useful for RSA public key generation. Tests: decimal (bit field). Specifies the methods used in checking for primality. Usually, more than one test is used. 0: not tested; often learned from peer during protocol operation, and saved for later analysis. 1: composite; failed one or more tests. In this case, the highest bit specifies the test that failed. 2: sieve; checked for division by a range of smaller primes. 4: Miller-Rabin. 8: Jacobi. 16: Elliptic Curve. Tries: decimal. Depends on the value of the highest valid Test bit, where the method specified is: 0: not tested (always zero). 1: composite (irrelevant). 2: sieve; number of primes sieved. Commonly on the order of 32,000,000. 4: Miller-Rabin; number of M-R iterations. Commonly on the order of 32 to 64. 8: Jacobi; unknown (always zero). 16: Elliptic Curve; unused (always zero). Size: decimal. Specifies the number of the most significant bit (0 to M). Generator: hex string. Specifies the best generator for a Diffie-Hellman exchange. 0 = unknown or variable, 2, 3, 5, etc. Modulus: hex string. The prime modulus. The file should be searched for moduli that meet the appropriate Time, Size and Generator criteria. When more than one meet the criteria, the selection should be weighted toward newer moduli, without completely disqualifying older moduli. Note that sshd(8) uses only the Size criteria and then selects a modulus at random if more than one meet the Size criteria. FILES
/etc/moduli SEE ALSO
qsieve(1), sshd(8) HISTORY
The moduli file appeared in OpenBSD 2.8 and NetBSD 1.6. BSD
February 7, 2005 BSD
All times are GMT -4. The time now is 07:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy