I got a sample file like this.
$ cat test
12|13|100|s
12|13|100|s
100|13|100|s
12|13|100|s
I want to replace all 100 by 2000 only in 3rd field using "awk"
This is replacing all 100's :-(
$ awk -F "|" '{gsub( /100/,"2000");print}' test
12|13|2000|s
12|13|2000|s
2000|13|2000|s... (5 Replies)
I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this:
abc ||| 5e-05 ||| bla
abc ||| 3 ||| ble
def ||| 1 ||| abc
def ||| 0.2 ||| def
As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
java....4059... compsite 62u IPv4 170747 TCP *:9400 (LISTEN)
java...... 05... compsite 109u IPv4 171216 TCP *:9401 (LISTEN)
This is Joust formated like this
Please Repace "." with space" "
All are Right Justfied
Output :- 4058 and 05 so that i can kill this (1 Reply)
need a one liner to compare 2nd and 3rd field and print values that are not matched in 2nd field
Input
col 2 col 3
1.1.1.1 11.11.11.11
8.8.8.8 0.0.0.0
3.3.3.3 2.2.2.2
7.7.7.7 3.3.3.3
5.5.5.5 1.1.1.1
4.4.4.4
6.6.6.6
9.9.9.9
output
7.7.7.7 ... (12 Replies)
Hi All,
I have a text file with three columns. I would like a simple script that removes lines in which column 1 has duplicate entries, but use the largest value in column 3 to decide which one to keep. For example:
Input file:
12345a rerere.rerere len=23
11111c fsdfdf.dfsdfdsf len=33 ... (3 Replies)
Hi,
I have a file (sorted by sort) with 8 tab delimited columns. The first column contains duplicated fields and I need to merge all these identical lines.
My input file:
comp100002 aaa bbb ccc ddd eee fff ggg
comp100003 aba aba aba aba aba aba aba
comp100003 fff fff fff fff fff fff fff... (5 Replies)
I've got a file that looks like this (the whitespace between commas is intentional):
123456789,12,JOHN H DOE ,DOE/JOHN H ,,,DOE/JOHN H ,,,,,123 FAKE STREET ,SPRINGFIELD,XX,
I want to strip just the first name out of the third field so it reads "JOHN,". So far I... (6 Replies)
Hi all!
I have 10.000 files having generally this format:
text text text
text num text num text num
text text text GAP number text text
text num text num text num RMS num
text num text num text num
...
what I want is to copy the files if the GAP number is lower than a value e.g. <100... (5 Replies)
Hi,
For example:
I have:
HostA,XYZ
HostB,XYZ
HostC,ABC
I would like the output to be:
HostA,HostB: XYZ
HostC:ABC
How can I achieve this?
So far what I though of is: (1 Reply)
Discussion started by: alvinoo
1 Replies
LEARN ABOUT SUNOS
new_field
form_field_new(3CURSES) Curses Library Functions form_field_new(3CURSES)NAME
form_field_new, new_field, dup_field, link_field, free_field - create and destroy forms fields
SYNOPSIS
cc [ flag... ] file... -lform -lcurses [ library... ]
#include <form.h>
FIELD *new_field(int r, int c, int frow, int fcol, int nrow, int ncol);
FIELD *dup_field(FIELD *field, int frow, int fcol);
FIELD *link_field(FIELD *field, int frow, int fcol);
int free_field(FIELD *field);
DESCRIPTION
new_field() creates a new field with r rows and c columns, starting at frow, fcol, in the subwindow of a form. nrow is the number of off-
screen rows and nbuf is the number of additional working buffers. This routine returns a pointer to the new field.
dup_field() duplicates field at the specified location. All field attributes are duplicated, including the current contents of the field
buffers.
link_field() also duplicates field at the specified location. However, unlike dup_field(), the new field shares the field buffers with the
original field. After creation, the attributes of the new field can be changed without affecting the original field.
free_field() frees the storage allocated for field.
RETURN VALUES
Routines that return pointers return NULL on error. free_field() returns one of the following:
E_OK Thefunction returned successfully.
E_CONNECTED The field is already connected to a form.
E_SYSTEM_ERROR System error.
E_BAD_ARGUMENT An argument is incorrect.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO curses(3CURSES), forms(3CURSES), attributes(5)NOTES
The header <form.h> automatically includes the headers <eti.h> and <curses.h>.
SunOS 5.10 31 Dec 1996 form_field_new(3CURSES)