Sponsored Content
Top Forums Shell Programming and Scripting Read n lines from a text files getting n from within the text file Post 302852977 by Don Cragun on Thursday 12th of September 2013 10:22:39 PM
Old 09-12-2013
Note that there are only 14 lines following the 1st line, but the 1st line contains #data: 15; is a line missing in your sample, or is the XXX value in the #data: XXX segments of the headers unreliable? (Note that since the header lines all start with a ">" and the data lines only contain floaing point values, the count in the header can be ignored.)

The counts in the other two header lines seem to match the following data.

Once you have read the data lines, what do you want to do with them?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read list of filenames from text file and remove these files in multiple directories

I have a large list of filenames from an Excel sheet, which I then translate into a simple text file. I'd like to use this list, which contains various file extensions , to archive these files and then remove them recursively through multiple directories and subdirectories. So far, it looks like... (5 Replies)
Discussion started by: fxvisions
5 Replies

2. Shell Programming and Scripting

Read any lines of text from file

Witam wszystkich , Jest to moj pierwszy post i już prośba ale gdybym potrafił zaradzić problemowi to nie zawracałbym nikomu głowy . mianowicie : Mam jakis 'plik' w ktorym są osadzone pojedyncze i zmienne słowa po jednym w lini czyli : test1 tekttw resst .... itd. Moje... (6 Replies)
Discussion started by: versace
6 Replies

3. Shell Programming and Scripting

Shell script to read lines in a text file and filter user data

hi all, I have this file with some user data. example: $cat myfile.txt FName|LName|Gender|Company|Branch|Bday|Salary|Age aaaa|bbbb|male|cccc|dddd|19900814|15000|20| eeee|asdg|male|gggg|ksgu|19911216||| aara|bdbm|male|kkkk|acke|19931018||23| asad|kfjg|male|kkkc|gkgg|19921213|14000|24|... (4 Replies)
Discussion started by: srimal
4 Replies

4. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

5. UNIX for Dummies Questions & Answers

Extracting lines from a text file based on another text file with line numbers

Hi, I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

6. Shell Programming and Scripting

Read text between two lines containing a string

Hi, I have text file like the following: Start a b 121 c d End Start a 31 e f End Start p o i k (5 Replies)
Discussion started by: ysrini
5 Replies

7. Shell Programming and Scripting

Comparing 2 text files & downloading a file if the last lines are different

Hello I'm having a little difficulty in writing a shell script for a few simple tasks. First I have two files "file1.txt" and "file2.txt" and I want to read and compare the last line of each file. The files look like this. File1.txt File2.txt After comparing the two lines I would... (2 Replies)
Discussion started by: RustikGaming
2 Replies

8. Shell Programming and Scripting

Extracting lines from text files in folder based on the numbers in another file

Hello, I have a file ff.txt that looks as follows *ABNA.txt 356 24 36 112 *AC24.txt 457 458 321 2 ABNA.txt and AC24.txt are the files in the folder named foo1. Based on the numbers in the ff.txt file, I want to extract the lines from the corresponding files in the foo1 folder and... (2 Replies)
Discussion started by: mohamad
2 Replies

9. Shell Programming and Scripting

Read text between regexps and write into files based on a field in the text

Hi, I have a huge file that has data something like shown below: huge_file.txt start regexp Name=Name1 Title=Analyst Address=Address1 Department=Finance end regexp some text some text start regexp Name=Name2 Title=Controller Address=Address2 Department=Finance end regexp (7 Replies)
Discussion started by: r3d3
7 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
DISTRIB.PATS(5) 					    InterNetNews Documentation						   DISTRIB.PATS(5)

NAME
distrib.pats - Default values for the Distribution: header DESCRIPTION
The file pathetc/distrib.pats is used by nnrpd to determine the default value of the Distribution: header. Blank lines and lines beginning with a number sign ("#") are ignored. All other lines consist of three fields separated by a colon: <weight>:<pattern>:<value> The first field is the weight to assign to this match. If a newsgroup matches multiple lines, the line with the highest weight is used. This should be an arbitrary integer greater than zero. The order of lines in the file is only important if groups have equal weight (in which case, the first matching line will be used). The second field is either the name of a newsgroup or a uwildmat(3)-style pattern to specify a set of newsgroups. The third field is the value that should be used for the Distribution: header of a posted article, if this line was picked as the best match and no Distribution: header was supplied by the user. It can be an empty string, specifying that no Distribution: header should be added. If it is not empty, it is better to only use US-ASCII characters for that field; otherwise, make sure it is encoded in UTF-8. When a post is received by nnrpd that does not already contain a Distribution: header, each newsgroup to which an article is posted will be checked against this file in turn, and the matching line with the highest weight will be used as the value of the Distribution: header. If no lines match, or if the matching line has an empty string for its third field, no header will be added. In case a distribution is added by nnrpd, make sure it is not rejected by the newsfeeds "ME" entry. A list of recommended distributions can be specified and described in distributions(5). HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Converted to POD by Russ Allbery <rra@stanford.edu>. $Id: distrib.pats.pod 8803 2009-11-15 09:29:41Z iulius $ SEE ALSO
distributions(5), inn.conf(5), newsfeeds(5), nnrpd(8), uwildmat(3). INN 2.5.2 2009-11-15 DISTRIB.PATS(5)
All times are GMT -4. The time now is 08:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy