Just to add that the code above won't work with not ordered input.
---------- Post updated at 11:50 AM ---------- Previous update was at 11:41 AM ----------
Quote:
Originally Posted by penchal_boddu
Hi radoulov,
could you please eloborate on the command.
Thanks in advance
An associative array named _ is created: $1 is the key, an incremented integer is the value.
Given the posted sample it yields:
Consider that the NULL (empty) string "" and the numeric value 0 are evaluated as false in boolean context.
So in this case you're saying: perform the default action (print the current record) if the following expression _[$1]++ returns false (not true, hence the exclamation mark !).
Hi All,
My question is if the simple but powerful shell scripts can extract data from a big data file by using a list of identifier. I used to put everything in the database and do joining, which sounds stupid but only way I knew. For example, my data file looks like,
... (3 Replies)
I have a very long string (millions of characters).
I have a file with start location and length that is thousands of rows long:
Start Length
5 10
16 21
44 100
215 37
...
I'd like to extract the substring that corresponds to the start and length from each row of the list:
I tried... (7 Replies)
HI,
i HAVE THE PROFILE LIST
ldapsearch -D cn=root -w root -p 389 mail=dgmp_ndl@bsnl.in
mail=dgmp_ndl@bsnl.in,o=Data Networks,o=Data Networks,o=Data Networks,o=Messagingdb,dc=bsnl,dc=in
I NEED TO SEPERATE ONLY THE MAIL ID
I m USING bash-2.05b$ ldapsearch -D cn=root -w root -p 389... (3 Replies)
Need to search a pattern occurrence (count) in a specified file.
Below is the details
$ cat fruits
apple apple
ball ball
apple
ball ball ball
apple apple apple
cat cat
cat cat cat
apple
apple
Note: If I'll use the grep command with -c option then it'll count the 1st occurrence in... (6 Replies)
Hi Gents,
I have a file 1 like this
1 1000 20
2 2000 30
3 1000 40
5 1000 50
And I have other file 1 like
2 1
I would like to get from the file 1 the complete line which are in file 2, the key to compare is the column 2 then output should be.
2 2000 30.
I was trying to get it... (5 Replies)
Hi,
I have a file with more than 28000 records and it looks like below..
>mm10_refflat_ABCD range=chr1:1234567-2345678
tgtgcacactacacatgactagtacatgactagac....so on
>mm10_refflat_BCD range=chr1:3234567-4545678...
tgtgcacactacacatgactagtatgtgcacactacacatgactagta
.
.
.
.
.
so on
... (2 Replies)
Please can someone help with this?
I have a file with lines as follows:
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
word1 word2 word3 word4 word5 word6 word7 word8
When I use the... (7 Replies)
Assume a string that contains one or multiple occurrences of three different keywords (abbreviated as "kw"). I would like to replace kw2 with some other string, say "qux". Specifically, I would like to replace that occurrence of kw2 that is the first one that is preceded by kw1 somewhere in the... (4 Replies)
I am trying to use awk to extract and print the first ocurrence of NM_ and NP_ with a : before in each line. The input file is tab-delimeted, but the output does not need to be. The below does execute but prints all the lines in the file not just the patterns. Thank you :).
file tab-delimeted
... (2 Replies)
Hi, i have file file.txt with data like:
START
03:11:30 a
03:11:40 b
END
START
03:13:30 eee
03:13:35 fff
END
jjjjjjjjjjjjjjjjjjjjj
START
03:14:30 eee
03:15:30 fff
END
ggggggggggg
iiiiiiiiiiiiiiiiiiiiiiiii
I want the below output
START (13 Replies)
Discussion started by: Jyotshna
13 Replies
LEARN ABOUT HPUX
vxmemstat
vxmemstat(1M)vxmemstat(1M)NAME
vxmemstat - display memory statistics for Veritas Volume Manager
SYNOPSIS
vxmemstat [-e] [-i interval [-t count]]
DESCRIPTION
The vxmemstat utility prints memory statistics information. This information can be system-wide, or it can be specific to a Veritas Volume
Replicator object.
OPTIONS -e Prints extended memory statistics.
-i interval
Prints memory statistics every interval seconds.
-t count Prints the local system time every count intervals. The time interval is specified using the -i interval option.
OUTPUT FORMAT
The statistics are prefaced by a timestamp showing the current local time on the system. Statistics are printed as a one-line output record
for each memory pool. The records are preceded by two header lines. The output line consists of blank-separated fields. All numeric fields
are in units of kilobytes.
The following fields are displayed on each line:
Pool Name of the memory pool. Memory consumers allocate memory from different pools for different purposes.
DG Name of the disk group in which the RVG is present.
Min Size Minimum amount of memory always reserved for use by consumers of the pool. As consumers require more memory, additional memory is
allocated to the pool for distribution to them.
Max Size Maximum amount of memory that can be allocated to the pool. This is equal to the value assigned to the maximum pool size system
tunable that corresponds to the pool.
In Use Amount of memory (out of that allocated) currently being used by consumers of the memory pool.
Allocated Amount of memory currently allocated to the memory pool. The amount of memory allocated to a pool ranges between the minimum and
the maximum pool size. The amount of allocated memory increases as more memory is needed and decreases as it is relinquished.
Max Used Maximum amount of memory used by consumers from this pool since system startup.
This field is not shown if the -e option is specified.
Max Pool Used
Maximum amount of memory used by consumers from this pool at any time since the last reboot. The value shows the maximum usage
even if usage by the pool has varied over this time period.
This field is shown if the -e option is specified.
Waiting Indicates if any I/O is waiting to allocate memory from this pool. This usually indicates that the corresponding tunable for the
maximum size of this pool needs to be increased.
This field is not shown if the -e option is specified.
Waiters The number of requests that are waiting to allocate memory from this pool.
This field is shown if the -e option is specified.
EXIT CODES
The vxmemstat utility exits with a non-zero status if the attempted operation fails. A non-zero exit code is not a complete indicator of
the problems encountered, but rather denotes the first condition that prevented further execution of the utility.
See vxintro(1M) for a list of standard exit codes.
EXAMPLES
To display statistics every 5 seconds and time stamp the output every alternate interval, use the command:
vxmemstat -i 5 -t 2
SEE ALSO vxintro(1M), vxstat(1M)VxVM 5.0.31.1 24 Mar 2008 vxmemstat(1M)