06-19-2009
Quote:
Originally Posted by
treesloth
Oh, wow... that's awesome. Thank you very much. A quick followup question of the sort that I usually hate...
If I read that correctly, it doesn't even require that the log entries be in date/time order. Is that so?
that's right - this's not necessary. On the flip side, however, the output will be in unsorted, random, unspecified order. The latter, can be easily fixed (if necessary - assuming the INCOMING order is temporal).
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to find the top N entries for a certain field based on the values of another field.
For example if N=3, we want the 3 best values for each entry:
Entry1 ||| 100
Entry1 ||| 95
Entry1 ||| 30
Entry1 ||| 80
Entry1 ||| 50
Entry2 ||| 40
Entry2 ||| 20
Entry2 ||| 10
Entry2 ||| 50... (1 Reply)
Discussion started by: FrancoisCN
1 Replies
2. Shell Programming and Scripting
Hi, all
I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes.
sample input:
for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies
3. Shell Programming and Scripting
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies
4. Shell Programming and Scripting
I am trying to parse the input in awk to include the |gc= in $4 but am not able to. The below is close:
awk so far:
awk '{sub(/\|]+]++/, ""); print }' input.txt Input
chr1 955543 955763 AGRN-6|pr=2|gc=75 0 +
chr1 957571 957852 AGRN-7|pr=3|gc=61.2 0 +
chr1 970621 ... (7 Replies)
Discussion started by: cmccabe
7 Replies
5. Shell Programming and Scripting
We have a csv file as mentioned below and the requirement is to change the date format in file as mentioned below.
Current file (file.csv)
----------------------
empname,date_of_join,dept,date_of_resignation
ram,08/09/2015,sales,21/06/2016
"akash,sahu",08/10/2015,IT,21/07/2016
... (6 Replies)
Discussion started by: gopal.biswal
6 Replies
6. Shell Programming and Scripting
In the tab-delimeted input file below I am trying to use awk to update the value in $2 if TYPE=ins in bold, by adding the value of
HRUN= in italics. In the below since in line 1 TYPE=ins the 117282541 value in $2 has 6 added because that is the value of HRUN=.
Hopefully the awk is a start but I... (2 Replies)
Discussion started by: cmccabe
2 Replies
7. Shell Programming and Scripting
I am trying to output a tab-delimited result that uses the data from a tab-delimited file to combine and subtract specific lines.
If $4 matches in each line then the first matching sequential $6 value is added to $2, unless the value is 1, then the original $2 is used (like in the case of line... (3 Replies)
Discussion started by: cmccabe
3 Replies
8. Shell Programming and Scripting
In the awk below I am trying to set/update the value of $14 in file2 in
bold, using the matching NM_ in $12 or $9 in file2
with the NM_ in $2 of file1.
The lengths of $9 and $12 can be variable but what is consistent is the start pattern
will always be NM_ and the end pattern is always ;... (2 Replies)
Discussion started by: cmccabe
2 Replies
9. Shell Programming and Scripting
Hi Team,
In the below input file, if I have the value 23,24,25 then for those records 1st field value should get updated from "a" to "b". I also want to pass these values in file as input as it can be done dynamically. Tried awk commands but not getting desired output.Using SunOS 5.10 version.... (14 Replies)
Discussion started by: weknowd
14 Replies
10. UNIX for Beginners Questions & Answers
Hi,
So awk is driving me crazy on this one. I have searched everywhere and read man, docs and every related post Google can find and still no luck. The actual files I need to run this on are sensitive in nature, but it is the same thing as if I needed to calculate weighted grades for multiple... (15 Replies)
Discussion started by: cotilloe
15 Replies
HLS(1) General Commands Manual HLS(1)
NAME
hls - list files in an HFS directory
SYNOPSIS
hls [options] [hfs-path ...]
DESCRIPTION
hls lists files and directories contained in an HFS volume. If one or more arguments are given, each specified file or directory is shown;
otherwise, the contents of the current working directory are shown.
OPTIONS
-1 Output is formatted such that each entry appears on a single line. This is the default when stdout is not a terminal.
-a All files and directories are shown, including "invisible" files, as would be perceived by the Macintosh Finder. Normally invisible
files are omitted from directory listings.
-b Special characters are displayed in an escaped backslash notation. Normally special or non-printable characters in filenames are
replaced by a question mark (?).
-c Sort and display entries by their creation date, rather than their modification date.
-d List directory entries themselves rather than their contents. Normally the contents are shown for named directories on the command-
line.
-f Do not sort directory contents; list them in the order they appear in the directory. This option effectively enables -a and -U and
disables -l, -s, and -t.
-i Show the catalog IDs for each entry. Every file and directory on an HFS volume has a unique catalog ID.
-l Display entries in long format. This format shows the entry type ("d" for directory or "f" for file), flags ("i" for invisible),
file type and creator (four-character strings for files only), size (number of directory sub-contents or file resource and data
bytes, respectively), date of last modification (or creation, with -c flag), and pathname. Macintosh "locked" files are indicated by
"F" in place of "f".
-m Display entries in a continuous format separated by commas.
-q Replace special and non-printable characters in displayed filenames with question marks (?). This is the default when stdout is con-
nected to a terminal.
-r Sort entries in reverse order before displaying.
-s Show the file size for each entry in 1K block units. The size includes blocks used for both data and resource forks.
-t Sort and display entries by time. Normally files will be sorted by name. This option uses the last modification date to sort unless
-c is also specified.
-x Display entries in column format like -C, but sorted horizontally into rows rather than columns.
-w width
Format output lines suitable for display in the given width. Normally the width will be determined from your terminal, from the
environment variable COLUMNS, or from a default value of 80.
-C Display entries in column format with entries sorted vertically. This is the default output format when stdout is connected to a
terminal.
-F Cause certain output filenames to be followed by a single-character flag indicating the nature of the entry; directories are fol-
lowed by a colon (:) and executable Macintosh applications are followed by an asterisk (*).
-N Cause all filenames to be output verbatim without any escaping or question-mark substitution.
-Q Cause all filenames to be enclosed within double-quotes (") and special/non-printable characters to be properly escaped.
-R For each directory that is encountered in a listing, recursively descend into and display its contents.
-S Sort and display entries by size. For files, the combined resource and data lengths are used to compute a file's size.
-U Do not sort directory contents; list them in the order they appear in the directory. On HFS volumes, this is usually an alphabetical
case-insensitive ordering, although there are some idiosyncrasies to the Macintosh implementation of ordering. This option does not
affect -a, -l, or -s.
SEE ALSO
hfsutils(1), hcd(1), hpwd(1), hdir(1), hcopy(1)
FILES
$HOME/.hcwd
AUTHOR
Robert Leslie <rob@mars.org>
HFSUTILS
14-Jan-1997 HLS(1)