Sponsored Content
Top Forums Shell Programming and Scripting Resume and count repeated values Post 302769593 by rdrtx1 on Tuesday 12th of February 2013 05:54:07 PM
Old 02-12-2013
try also (sorted output):
Code:
awk '
{for (i=1; i<=NF; i++) $i=$i+0;
 if (!a[$1]) mx[$1]=mn[$1]=$2;
 a[$1]=$1; b[$1]=$NF; c[$1]++;
 if ($2<mn[$1]) mn[$1]=$2;
 if ($2>mx[$1]) mx[$1]=$2;
}
END {
  for (i in a) print i, mn[i], mx[i], b[i], c[i];
}
' FS="," OFS="\t" infile

This User Gave Thanks to rdrtx1 For This Post:
 

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Are companies viewing my resume? How do I track my resume visits?

Hi everybody, I am wondering if there is any tool or website out there which can track who is viewing my resume. It is very frustrating when you send your CV or Cover Letter and you receive no feedback from the company, you don't even know if they have checked it out. Thanks for your help (1 Reply)
Discussion started by: gearyipswich
1 Replies

2. Programming

Count the number of repeated characters in a given string

i have a string "dfasdfasdfadf" i want to count the number of times each character is repeated.. For instance, d is repeated 4 times, f is repeated 4 times.. can u give a program in c (1 Reply)
Discussion started by: pgmfourms
1 Replies

3. Shell Programming and Scripting

To Delete the repeated occurances and print in same line by appending values

Hi All, I am trying to work on below text a b c 1 a b c 2 a b c 3 x y z 6 x y z 44 a b c 89 Need to delete the occurances and get in single line like below: a b c 1 2 3 89 x y z 6 44 89 Please help me i am new into unix scripting ..... ---------- Post updated at 03:00... (8 Replies)
Discussion started by: shaliniyadav
8 Replies

4. Shell Programming and Scripting

comparing the values of repeated keys in multiple columns

Hi Guyz The 1st column of the input file has repeated keys like x,y and z. The ist task is if the 1st column has unique key (say x) and then need to consider 4th column, if it is + symbol then subtract 2nd column value with 3rd column value (we will get 2(10-8)) or if it is - symbol subtract 3rd... (3 Replies)
Discussion started by: repinementer
3 Replies

5. Hardware

Cannot resume from suspend with new motherboardktop, does not resume properly

I would like to get pm-suspend (or any other suspend method) working for a small new desktop computer. It is based on a Zotac GF-8200 ITX motherboard and an AMD Athlon II X@ 240 CPU using ArchLinux x86_64. The pm-suspend script works, apparently putting the machine into suspend correctly... (0 Replies)
Discussion started by: lagagnon
0 Replies

6. Shell Programming and Scripting

Help in counting the no of repeated words with count in a file

Hi Pls help in solving my doubt.Iam having file like below file1.txt priya jenny jenny priya raj radhika priya bharti bharti Output required: I need a output like count of repeated words with name for ex: priya 3 jenny 2 (4 Replies)
Discussion started by: bha148
4 Replies

7. UNIX for Dummies Questions & Answers

Extracting column if above certain values and repeated over a number of times continuously

Hi I am new to the forum and would like to ask: i have a file in form with thousands of column id.1 A01 A01 A68 A68 id.2 A5 A5 A3 A3 1001 0 0 0.136 0.136 1002 0 0 0.262 0.183 1003 0 0 0.662 0.662 1004 0 0 ... (9 Replies)
Discussion started by: newbeeuk
9 Replies

8. Shell Programming and Scripting

Finding most repeated entry in a column and giving the count

Please can you help in providing the most repeated entry in the 2nd column and give its count Here is an input file 1, This , is a forum 2, This , is a forum 1, There , is a forum 2, This , is not right Here the most repeated entry is "This" and count is 3 So output... (4 Replies)
Discussion started by: necro98
4 Replies

9. Shell Programming and Scripting

Put repeated values into a table

Hi all, I have blocks of records like the following, each block ends in = in a new line, I want tabularize the entire output. The pattern is the same in every block although not all types are there in every block. For example gine3 is absent in the second block but present first and third. ... (7 Replies)
Discussion started by: ritakadm
7 Replies

10. Shell Programming and Scripting

Adding the values of repeated ids

File1 consist two columns, first some weired ids and second the numbers t|v203.1@t|k88711.1 0.1 t|v190.1@t|k90369.1 0.01 t|v203.1@t|k88711.1 0.5 t|v322.1@t|k88711.1 0.2 t|v207.1@t|k90369.1 0.11 t|v326.1@t|k85939.1 0.5 t|v207.1@t|k90369.1 0.7 t|v207.1@t|k90369.1 0.3 t|v326.1@t|k89421.1 0.33... (3 Replies)
Discussion started by: ashmit99
3 Replies
tnameserv(1)						      General Commands Manual						      tnameserv(1)

NAME
tnameserv - Java IDL name server starter script SYNOPSIS
tnameserv -ORBInitialPort portNumber DESCRIPTION
The CORBA COS (Common Object Services) Naming Service provides a tree-like directory for object references much like a filesystem provides a directory structure for files. The Naming Service provided with Java IDL is a simple implementation of the COS Naming Service specifica- tion. Object references are stored in the namespace by name and each object reference-name pair is called a name binding. Name bindings may be organized under naming contexts. Naming contexts are themselves name bindings and serve the same organizational function as a file system subdirectory. All bindings are stored under the initial naming context. The initial naming context is the only persistent binding in the namespace; the rest of the namespace is lost if the Java IDL name server process halts and restarts. For an applet or application to use COS naming, its ORB must know the name and port of a host running a naming service or have access to a stringified initial naming context for that name server. The naming service can either be the Java IDL name server or another COS-compli- ant name service. USAGE
Starting the Java IDL Name Server You must start the Java IDL name server before an application or applet that uses its naming service. Installation of the Java IDL product creates a script named tnameserv that starts the Java IDL name server. Start the name server so it runs in the background. If you do not specify otherwise, the Java IDL name server listens on port 900 for the bootstrap protocol used to implement the ORB resolve_initial_references() and list_initial_references() methods. Specify a different port, for example, 1050, as follows: example% tnameserv -ORBInitialPort 1050 Clients of the name server must be made aware of the new port number. Do this by setting the org.omg.CORBA.ORBInitialPort property to the new port number when creating the ORB object. Stopping the Java IDL Name Server To stop the Java IDL name server, use the relevant operating system command, such as kill(1). Note that names registered with the Java IDL name service disappear when the server is terminated. Sample Client: Adding Objects The following sample program illustrates how to add names to the namespace. It is a self-contained Name Server client that creates the following simple tree. Initial Naming Context / / plans personal / / calendar schedule In this example, "plans" is an object reference and "personal" is a naming context that contains two object references: "calendar" and "schedule". import java.util.Properties; import org.omg.CORBA.*; import org.omg.CosNaming.*; public class NameClient { public static void main(String args[]) { try { In the above section, Starting the Java IDL Name Server, the nameserver was started on port 1050. The following code ensures that the client program is aware of this port number. Properties props = new Properties(); props.put("org.omg.CORBA.ORBInitialPort", "1050"); ORB orb = ORB.init(args, props); The following code obtains the initial naming context and assigns it to ctx. The second line copies ctx into a dummy object reference, objref, that we will attach to various names and add into the namespace. NamingContext ctx = NamingContextHelper.narrow (orb.resolve_initial_references("NameService")); NamingContext objref = ctx; The following code creates a name "plans" of type "text" and binds it to our dummy object reference. "plans" is then added under the ini- tial naming context using rebind. The rebind method allows us to run this program over and over again without getting the exceptions we would get from using bind. NameComponent nc1 = new NameComponent("plans", "text"); NameComponent[] name1 = {nc1}; ctx.rebind(name1, objref); System.out.println("plans rebind sucessful!"); The following code creates a naming context called "Personal" of type "directory". The resulting object reference, ctx2, is bound to the name and added under the initial naming context. NameComponent nc2 = new NameComponent("Personal", "directory"); NameComponent[] name2 = {nc2}; NamingContext ctx2 = ctx.bind_new_context(name2); System.out.println("new naming context added.."); The remainder of the code binds the dummy object reference using the names "schedule" and "calendar" under the "Personal" naming context (ctx2). NameComponent nc3 = new NameComponent("schedule", "text"); NameComponent[] name3 = {nc3}; ctx2.rebind(name3, objref); System.out.println("schedule rebind sucessful!"); NameComponent nc4 = new NameComponent("calender", "text"); NameComponent[] name4 = {nc4}; ctx2.rebind(name4, objref); System.out.println("calender rebind sucessful!"); } catch (Exception e) { e.printStackTrace(System.err); } } } Sample Client: Browsing the Namespace The following sample program illustrates how to browse the namespace. import java.util.Properties; import org.omg.CORBA.*; import org.omg.CosNaming.*; public class NameClientList { public static void main(String args[]) { try { In the above section, Starting the Java IDL Name Server, the nameserver was started on port 1050. The following code ensures that the client program is aware of this port number. Properties props = new Properties(); props.put("org.omg.CORBA.ORBInitialPort", "1050"); ORB orb = ORB.init(args, props); The following code obtains the initial naming context. NamingContext nc = NamingContextHelper.narrow (orb.resolve_initial_references("NameService")); The list method lists the bindings in the naming context. In this case, up to 1000 bindings from the initial naming context will be returned in the BindingListHolder; any remaining bindings are returned in the BindingIteratorHolder. BindingListHolder bl = new BindingListHolder(); BindingIteratorHolder blIt= new BindingIteratorHolder(); nc.list(1000, bl, blIt); The following code gets the array of bindings out of the returned BindingListHolder. If there are no bindings, the program ends. Binding bindings[] = bl.value; if (bindings.length == 0) return; The remainder of the code loops through the bindings and prints the names out. for (int i=0; i < bindings.length; i++) { // get the object reference for each binding org.omg.CORBA.Object obj = nc.resolve (bindings[i].binding_name); String objStr = orb.object_to_string(obj); int lastIx = bindings[i].binding_name.length-1; // check to see if this is a naming context if (bindings[i].binding_type == BindingType.ncontext) { System.out.println ("Context: " + bindings[i].binding_name[lastIx].id); } else { System.out.println ("Object: " + bindings[i].binding_name[lastIx].id); } } } catch (Exception e) { e.printStackTrace(System.err); } } } SEE ALSO
kill(1) 13 June 2000 tnameserv(1)
All times are GMT -4. The time now is 01:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy