Sponsored Content
Full Discussion: Count per line in txt file
Top Forums Shell Programming and Scripting Count per line in txt file Post 302610853 by itkamaraj on Thursday 22nd of March 2012 12:09:31 AM
Old 03-22-2012
Try this..
Code:
 
awk '/LISTENER /,/SQL/{a=a"\n"$0;b[i]=$2;i++}END{gsub("SQL>","",a);for(i in b){if(b[i]>5500 && b[i]!~/[C\-]/){print b[i];print a;exit}}}'
  LISTENER      COUNT                                                            
---------- ----------                                                            
       930       5145                                                            
       931       5344                                                            
       932       5387                                                            
       933       5517                                                            
       934       4942

This User Gave Thanks to itkamaraj For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to read last line of a txt file?

I need to read the last file for a particular day, such as, "Jun 13" because the CSV file is cumulative for the entire day, so I don't want all the previous files, I just want the last file, for that day. I ran an 'ls -al | grep "June 13" > myLs.txt' (simplified) to list all files from that day.... (2 Replies)
Discussion started by: yongho
2 Replies

2. Shell Programming and Scripting

i need to read the last line in a txt file

i'm a beginner in shell and i have a txt file that is updating every second or msec so i need a program to read the last line of this txt file is this possible to do? (5 Replies)
Discussion started by: _-_shadow_-_
5 Replies

3. Programming

Reading a particular line from a .txt file

Hi, I have a .txt file which contains the x, y and z co-ordinates of particles which I am trying to cast for a particular compound. The no. of particles present is of the order of 2 billion and hence the size of the text file is of the order of a few Gigabytes. The particles have been casted layer... (5 Replies)
Discussion started by: mugga
5 Replies

4. Shell Programming and Scripting

write filename as first line in a txt file

Could anyone very kindly help me a simple way to perform the - perhaps - very trivial task of writing the name of a file as first line of that file which is in txt format? And would be possible to do this recursively for some thousands files in the XY directory? And, again, add to the simple... (3 Replies)
Discussion started by: mjomba
3 Replies

5. Shell Programming and Scripting

count of null in pipe delimited txt file

Hi, I have a pipe delimited txt file which contains 17 fields per line/row. 16th field contains email id. I want to count the number of lines/rows that contains null in the 16th field. Plz find attached example data file. I'm looking for a command line/script which achieves this. ... (5 Replies)
Discussion started by: Sriranga
5 Replies

6. Shell Programming and Scripting

Changing Line in Txt File

So I have a python program that I run, which runs accordingly to options I have listed in a text file (ie user_prefs). Now there are many options listed in this user_prefs.txt, but the one of most interest to me is that of the file path of the time series. I have over a hundred of these time... (8 Replies)
Discussion started by: Jimmyd24
8 Replies

7. Shell Programming and Scripting

create txt file form data file and add some line on it

Hi Guys, I have file A.txt File A Data AK1521 AK2536 AK3164 I want create text file of all data above and write some data on each file. want Output on below folder /home/kka/out AK1521.txt Hi Welocme (3 Replies)
Discussion started by: asavaliya
3 Replies

8. Shell Programming and Scripting

Need to append the date | abcddate.txt to the first line of my txt file

I want to add/append the info in the following format to my.txt file. 20130702|abcd20130702.txt FN|SN|DOB I tried the below script but it throws me some exceptions. <#!/bin/sh dt = date '+%y%m%d'members; echo $dt+|+members+$dt; /usr/bin/awk -f BEGIN { FS="|"; OFS="|"; } { print... (6 Replies)
Discussion started by: harik1982
6 Replies

9. UNIX for Dummies Questions & Answers

Split Every Line In Txt Into Separate Txt File, Named Same As The Line

Hi All Is there a way to export every line into new txt file where by the title of each txt output are same as the line ? I have this txt files containing names: Kandra Vanhooser Rhona Menefee Reynaldo Hutt Houston Rafferty Charmaine Lord Albertine Poucher Juana Maes Mitch Lobel... (2 Replies)
Discussion started by: Nexeu
2 Replies

10. Shell Programming and Scripting

Switch line in txt file

Hi I have problem with replace line in txt file , I have this string: 144185 DISK Piece qqr8ot6l_1_1 -- 144186 DISK Piece ukr8pf2e_1_1 -- 144187 DISK Piece ter8p9gc_1_1 -- 144188 DISK Piece 4er8qb84_1_1 and (8 Replies)
Discussion started by: primo102
8 Replies
SQL::Translator::Producer::TTSchema(3pm)		User Contributed Perl Documentation		  SQL::Translator::Producer::TTSchema(3pm)

NAME
SQL::Translator::Producer::TTSchema - Produces output using the Template Toolkit from a SQL schema SYNOPSIS
use SQL::Translator; my $translator = SQL::Translator->new( from => 'MySQL', filename => 'foo_schema.sql', to => 'TTSchema', producer_args => { ttfile => 'foo_template.tt', # Template file to use # Extra template variables ttargs => { author => "Mr Foo", }, # Template config options ttargs => { INCLUDE_PATH => '/foo/templates', }, }, ); print $translator->translate; DESCRIPTION
Produces schema output using a given Template Tookit template. It needs one additional producer_arg of "ttfile" which is the file name of the template to use. This template will be passed a variable called "schema", which is the "SQL::Translator::Producer::Schema" object created by the parser. You can then use it to walk the schema via the methods documented in that module. Here's a brief example of what the template could look like: database: [% schema.database %] tables: [% FOREACH table = schema.get_tables %] [% table.name %] ================ [% FOREACH field = table.get_fields %] [% field.name %] [% field.data_type %]([% field.size %]) [% END -%] [% END %] See t/data/template/basic.tt for a more complete example. The template will also get the set of extra variables given as a hashref via the "tt_vars" producer arg. You can set any of the options used to initiallize the Template object by adding a tt_conf producer_arg. See Template Toolkit docs for details of the options. (Note that the old style of passing this config directly in the producer args has been deprecated). $translator = SQL::Translator->new( to => 'TT', producer_args => { ttfile => 'foo_template.tt', ttargs => {}, tt_conf = { INCLUDE_PATH => '/foo/templates/tt', INTERPOLATE => 1, } }, ); You can use this producer to create any type of text output you like, even using it to create your own versions of what the other producers make. For example, you could create a template that translates the schema into MySQL's syntax, your own HTML documentation, your own Class::DBI classes (or some other code) -- the opportunities are limitless! Producer Args ttfile The template file to generate the output with. tt_vars A hash ref of extra variables you want to add to the template. tt_conf A hash ref of configuration options to pass to the Template object's constructor. AUTHOR
Mark Addison <grommit@users.sourceforge.net>. TODO
More template vars? e.g. [% tables %] as a shortcut for [% schema.get_tables %]. SEE ALSO
SQL::Translator. perl v5.14.2 2012-01-18 SQL::Translator::Producer::TTSchema(3pm)
All times are GMT -4. The time now is 05:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy