05-12-2008
outputting data in table from grep results
Hi all. I'm a real unix newbie and looking for some help on a shell scripting problem. I'm going the longest ways around everything but I'm getting there.
My next problem however has me stumped.
I have set up a program that takes inputs from a user for a particular month and year (and stores them in variables) then searches a list of hits files for these values.
The hits files all contain information on webpage visits, so the hits for adventure.html are stored in adventure.hits.
These hit files are made up of several columns:
103.45.155.82 Tue Nov 15 03:23:42 GMT 2006
My script so far will search all of those hits files for the specified month and year, so Nov 2006 for example, then outputs the results to a temporary file.
This temporary file records all the columns for the records matching the search criteria as well as listing the filename in the first column. like this:
adventure.hits:103.45.155.82 Tue Nov 15 03:23:42 GMT 2006
I need to now output a table to the terminal that shows data under headings like this:
Page Name - Hits - Unique Hits
adventure.hits 58 18
sports.hits 107 12
Any ideas how to go about this?
Thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Newbie question -- any help very much appreciated: I want to be able to get grep (or whatever else would work) to return not only matching lines, but also the original input string:
An example may help: Suppose I have two files data1.txt and data2.txt:
data1.txt
Hello my name is foo.
What... (3 Replies)
Discussion started by: tapmas
3 Replies
2. Shell Programming and Scripting
I have information in a file called HITS. This file has been populated by the user entering search criteria.
the HITS file contains information:
filname.hits: 123.33.345.66 Fri Nov 26 11.45.56.43 GMT 2006
at the moment i am just displayin the information using cat HITS.
... (3 Replies)
Discussion started by: amatuer_lee_3
3 Replies
3. Shell Programming and Scripting
Hi guys, looking for a bit of advise, and as I am a complete novice, please excuse the daft questions!!
I have a list of events and of which entry looks like this;
#
# Event 1
# NAME = Event 1
#
12345 : 123 : 1 : 1 : L,1,N : 1,0 : Event
#
# Event 2
# NAME = Event 2
#
12346... (8 Replies)
Discussion started by: JayC89
8 Replies
4. Shell Programming and Scripting
I had a question about grep.
If I grep for something in a file, the output shows me all the lines in which that 'something' is contained in.
Is there a way to also output all the lines in which that 'something' wasnt contained in.
Say I have a file with a bunch of names and I do:
grep scott... (2 Replies)
Discussion started by: ndedhia1
2 Replies
5. Shell Programming and Scripting
Hello,
Currently i have a ksh script which will disply the results in plain text format.
I want to format the result in more readable format like Making bold headings and format with colors etc. Something like html or excel format and send that content as email.
Please help me how i can do... (2 Replies)
Discussion started by: kotasateesh
2 Replies
6. Shell Programming and Scripting
Hello everyone,
I have a shell script, which connects to the database and runs .sql file.
after executing of .sql file, i need to store the results in error table.
How can i achieve this one? could you please give your suggestions.
here is my code.
#!/bin/sh
#set -vx
SCHEMA_NAME=$1... (1 Reply)
Discussion started by: Rami Reddy
1 Replies
7. Shell Programming and Scripting
Hello,
Currently i have a script which will disply the results in plain text format.
I want to format the result in more readable format like Making bold headings and format with colors etc. Something like html and send that content as email.
Please help me how i can do that.
I am using... (10 Replies)
Discussion started by: joy lobo
10 Replies
8. Shell Programming and Scripting
I'm looking for some suggestions on a command line utility I am making. I would like to use 'find' to locate some files and index the results so the user can choose the correct results from the list and push that input into an open command. A simple example below:
... (2 Replies)
Discussion started by: sudo
2 Replies
9. Shell Programming and Scripting
Hello,
I'm trying to send email from Greenplum query results as HTML table with status Red/Green
Select Server, Last_Date from Table;
Results
Server, Last_Date
Prod, 2018-04-09
Final email Output in HTML format
Server Status LastDate
Prod GREEN(BOX) 2018-04-09 (if... (2 Replies)
Discussion started by: krux_rap
2 Replies
10. Shell Programming and Scripting
I have a log file that looks like this. the lines are grouped. 2 lines per entry.
M: 2019-01-25 13:02:31.698 P25, received network transmission from KI4EKI to TG 10282
M: 2019-01-25 13:02:35.694 P25, network end of transmission, 4.3 seconds, 1% packet loss
M: 2019-01-25 13:02:38.893 P25,... (7 Replies)
Discussion started by: ae4ml
7 Replies
LEARN ABOUT DEBIAN
seqfraggle
SEQFRAGGLE(1e) EMBOSS Manual for Debian SEQFRAGGLE(1e)
NAME
seqfraggle - Removes fragment sequences from DHF files.
SYNOPSIS
seqfraggle -dhfinpath dirlist -thresh integer -dhfoutdir outdir
seqfraggle -help
DESCRIPTION
seqfraggle is a command line program from EMBOSS ("the European Molecular Biology Open Software Suite"). It is part of the "Protein:3D
Structure" command group(s).
OPTIONS
Input section
-dhfinpath dirlist
This option specifies the location of DHF files (domain hits files) or other sequence files (input). A 'domain hits file' contains
database hits (sequences) with domain classification information, in FASTA or EMBL formats. The hits are relatives to a SCOP or CATH
family and are found from a search of a sequence database. Files containing hits retrieved by PSIBLAST are generated by using
SEQSEARCH. Alternatively, SEQFRAGGLE will accept sequence or sequence sets in any of the common formats. Default value: ./
Required section
-thresh integer
This option specifies the percentage of median length for definition of fragments. SEQFRAGGLE first determines the median length of all
the sequences in the input file, then discards any hit sequences which are not within a threshold percentage of the median length. The
remaining sequences are written to the output file. Default value: 50
Output section
-dhfoutdir outdir
This option specifies the location of DHF files (domain hits files) (output). A 'domain hits file' contains database hits (sequences)
with domain classification information, in FASTA or EMBL formats. The hits are relatives to a SCOP or CATH family and are found from a
search of a sequence database. Files containing hits retrieved by PSIBLAST are generated by using SEQSEARCH. Alternatively, SEQFRAGGLE
will write output files in any of the common formats. Default value: ./
BUGS
Bugs can be reported to the Debian Bug Tracking system (http://bugs.debian.org/emboss), or directly to the EMBOSS developers
(http://sourceforge.net/tracker/?group_id=93650&atid=605031).
SEE ALSO
seqfraggle is fully documented via the tfm(1) system.
AUTHOR
Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Wrote the script used to autogenerate this manual page.
COPYRIGHT
This manual page was autogenerated from an Ajax Control Definition of the EMBOSS package. It can be redistributed under the same terms as
EMBOSS itself.
DOMSEARCH 0.1.0++20100721 08/11/2010 SEQFRAGGLE(1e)