Sponsored Content
Top Forums UNIX for Dummies Questions & Answers keeping last record among group of records with common fields (awk) Post 302711559 by beca123456 on Sunday 7th of October 2012 02:56:27 AM
Old 10-07-2012
Thanks elixir_sinari. I got it now for this way !

And what about if I wanted to keep the highest value in the last field instead of the last line (which is the same here but just for me to know)?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk: record has too many fields

Hi, I'm trying this command - but get this error. Do you guys have any workaround for this? cat tf|sed 's/{//g'|sed 's/,//g'|awk '{for (i=1;i<=NF;i++) {if ($i == "OPTIME") {k = i + 2; print $i,$k}}}' awk: record `2005 Jul 28 17:35:29...' has too many fields record number 15 This is how... (3 Replies)
Discussion started by: chaandana
3 Replies

2. Infrastructure Monitoring

Processing records as group - awk

I have a file has following records policy glb id 1233 name Permit ping from "One" to "Second" "Address1" "Any" "ICMP-ANY" permit policy id 999251 service "snmp-udp" exit policy glb id 1234 name Permit telnet from "One" to "Second" "Address2" "Any" "TCP-ANY" permit policy id 1234... (3 Replies)
Discussion started by: baskar
3 Replies

3. Shell Programming and Scripting

Print all the fields of record using awk

Hi, i want to generate print statement using awk. i have 20+ and 30+ fields in each line Now its priting only first eight fields print statement as output not all. my record is as shown below filename ... (2 Replies)
Discussion started by: raghavendra.nsn
2 Replies

4. Shell Programming and Scripting

Common records using AWK

Hi, To be honest, I am really impressed and amazed at the pace I find solutions for un-solved coding mysteries in this forum. I have a file like this input1.txt x y z 1 2 3 a b c 4 -3 7 k l m n 0 p 1 2 a b c 4 input2 x y z 9 0 -1 a b c 0 6 9 k l m 8 o p 1 2 a f x 9 Output... (9 Replies)
Discussion started by: jacobs.smith
9 Replies

5. Shell Programming and Scripting

Finding out the common lines in two files using 4 fields with the help of awk and UNIX

Dear All, I have 2 files. If field 1, 2, 4 and 5 matches in both file1 and file2, I want to print the whole line of file1 and file2 one after another in my output file. File1: sc2/80 20 . A T 86 F=5;U=4 sc2/60 55 . G T ... (1 Reply)
Discussion started by: NamS
1 Replies

6. Shell Programming and Scripting

awk - compare 1st 15 fields of record with 20 fields

I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies

7. Shell Programming and Scripting

awk print matching records and occurences of each record

Hi all , I have two files : dblp.xml with dblp records and itu1.txt with faculty members records. I need to find out how many dblp records are related to the faculty members. More specific: I need to find out which names from itu1.txt are a match in dblp. xml file , print them and show how many... (4 Replies)
Discussion started by: iori
4 Replies

8. Shell Programming and Scripting

Sorting group of records and loading last record

Hi Everyone, I have below record set. File is fixed widht file 101newjersyus 20150110 101nboston us 20150103 102boston us 20140106 102boston us 20140103 I need to group record based on first 3 letters in our case(101 and 102) and sort last 8 digit in ascending order and print only... (4 Replies)
Discussion started by: patricjemmy6
4 Replies

9. Shell Programming and Scripting

Keeping record of file 2 based on a reference file 1 in awk

I have 2 input files (tab separated): file1: make_A 1990 foo bar make_B 2010 this that make_C 2004 these those file2: make_X 1970 1995 ref_1:43 ref_2:65 make_A 1970 1995 ref_1:4 ref_2:21 ref_3:18 make_A 1980 2002 ref_1:7 ref_2:7 ref_3:0 ... (2 Replies)
Discussion started by: beca123456
2 Replies

10. UNIX for Beginners Questions & Answers

Awk: group multiple fields from different records

Hi, My input looks like that: A|123|qwer A|456|tyui A|456|wsxe B|789|dfgh Using awk, I am trying to get: A|123;456|qwer;tyui;wsxe B|789|dfgh For records with same $1, group all the $2 in a field (without replicates), and all the $3 in a field (without replicates). What I have tried:... (6 Replies)
Discussion started by: beca123456
6 Replies
ACTIVE(5)                                                       File Formats Manual                                                      ACTIVE(5)

NAME
active, active.times - list of active Usenet newsgroups DESCRIPTION
The file /var/lib/news/active lists the newsgroups that the local site receives. Each newsgroup should be listed only once. Each line specifies one group; their order in the file does not matter. Within each newsgroup, articles are assigned unique names, which are mono- tonically increasing numbers. If an article is posted to newsgroups not mentioned in this file, those newsgroups are ignored. If no valid newsgroups are specified, the article is filed into the newsgroup ``junk'' and only propagated to sites that receive the ``junk'' newsgroup. Each line consists of four fields specified by a space: name himark lomark flags The first field is the name of the newsgroup. The second field is the highest article number that has been used in that newsgroup. The third field is the lowest article number in the group; this number is not guaranteed to be accurate, and should only be taken to be a hint. Note that because of article cancellations, there may be gaps in the numbering sequence. If the lowest article number is greater then the highest article number, then there are no articles in the newsgroup. In order to make it possible to update an entry in-place without rewriting the entire file, the second and third fields are padded out with leading zeros to make them a fixed width. The fourth field can contain one of the following flags: y Local postings are allowed n No local postings are allowed, only remote ones m The group is moderated and all postings must be approved j Articles in this group are not kept, but only passed on x Articles cannot be posted to this newsgroup =foo.bar Articles are locally filed into the ``foo.bar'' group If a newsgroup has the ``j'' flag, then no articles will be filed into that newsgroup and local postings to that group should not be gener- ated. If an article for such a newsgroup is received from a remote site, it will be filed into the ``junk'' newsgroup if it is not cross- posted. This is different from not having a newsgroup listed in the file because sites can subscribe to ``j'' newsgroups and the article will be propagated to them. If the fourth field of a newsgroup starts with an equal sign, then the newsgroup is an alias. Articles can be posted to the group, but will be treated as if they were posted to the group named after the equal sign. The second and third fields are ignored. Note that the Newsgroup header is not modified (Alias groups are typically used during a transition, and are typically created with ctlinnd(8)). An alias newsgroup should not point to another alias. The file /var/lib/news/active.times provides a chronological record of when newsgroups are created. This file is normally updated by innd(8) whenever a ctlinnd ``newgroup'' command is done. Each line consist of three fields: name time creator The first field is the name of the newsgroup. The second field is the time it was created, expressed as the number of seconds since the epoch -- i.e., a time_t; see gettimeofday(2). The third field is the electronic mail address of the person who created the group. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.13, dated 1996/10/29. SEE ALSO
ctlinnd(8), innd(8). ACTIVE(5)
All times are GMT -4. The time now is 06:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy