Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Grep SQL output file for greater than number. Post 302891414 by Yoda on Wednesday 5th of March 2014 03:55:21 PM
Old 03-05-2014
Code:
value=$( awk '/\| /{gsub(/\|| */,x);print}' sql.out )

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to grep / zgrep to output ONLY the matching filename and line number?

Hi all, I am trying to zgrep / grep list of files so that it displays only the matching filename:line number and does not display the whole line, like: (echo "1.txt";echo "2.txt") | xargs zgrep -no STRING If I use -o option, it displays the matching STRING and if not used, displays the... (3 Replies)
Discussion started by: vvaidyan
3 Replies

2. UNIX for Dummies Questions & Answers

how to grep a number from output line

I`m having a output shown below, CFR 235,BBC DM-2 ALL CFR 111,BBC DM-2 ALL CFR 333,BBC DM-2 ALL from the above Output i want to use 235,111,333 as input for other purpose. these no always change every time i run script.so please suggest me the way i could do it with example,i have tried... (5 Replies)
Discussion started by: nitin_aaa27
5 Replies

3. Shell Programming and Scripting

How to grep a pattern having value greater than 123 in a file?

Hi, I have a dynamically growing ascii file which has large data (both text and digits). I need to grep those lines having value greater than '123'. These numeric values may appear at anywhere in the line, hence I could not use awk to split to columns. So, please help me with the grep regular... (12 Replies)
Discussion started by: royalibrahim
12 Replies

4. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

5. Shell Programming and Scripting

Egrep a greater than number

data: hello mr smith 400 you all ok? hello mrs. smith 700 you all ok? hello mr. everyone 150 you all ok? hello mr. you all 199 im lad you are ok using egrep, how can i grep out only lines that have a number greater than 250? cat data | egrep ..... can't use awk here. i was... (7 Replies)
Discussion started by: SkySmart
7 Replies

6. Shell Programming and Scripting

Egrep a number greater than in a column

i'm aware awk can do what i'm trying to do here. but i cant use awk in this scenario given the circumstance of this box. but i need to check if a number is a certain column is over a certain value, say for instance, 20. data: | 12 | 19 | 2000 | 9029333 |... (11 Replies)
Discussion started by: SkySmart
11 Replies

7. Shell Programming and Scripting

Grep lines for number greater than given number

Hello, I am newbie to bash scripting. Could someone help me with the following. I have log file with output as shown below **************************LOG************************* 11/20/2013 9:11:23.64 Pinging xx.xx.xx.xx with 32 bytes of data: 11/20/2013 9:11:23.64 Reply from xx.xx.xx.xx:... (4 Replies)
Discussion started by: meena_2013
4 Replies

8. UNIX for Dummies Questions & Answers

Greater than specific number

please let me know how to construct if then else by comparing two numbers if it is greater than 10000. I need to do some specific task executed. can you help me out in shell scripting plz. (6 Replies)
Discussion started by: ramkumar15
6 Replies

9. UNIX for Beginners Questions & Answers

How do I use grep to grab prime number output from my factor program?

I have a factor program that runs and outputs to stdout all the prime numbers that are specified in the given paramters, in this case 30000000-31000000. Command: factor/factor 30000000-31000000 Sample output: 30999979 = 30999979 30999980 = 2^2 5 11 140909 30999981 = 3 10333327... (6 Replies)
Discussion started by: steezuschrist96
6 Replies

10. UNIX for Beginners Questions & Answers

How to output non-number lines with grep?

I want to check my data quality. I want to output the lines with non-number. I used the grep command: grep '' myfile.csv Since my file is csv file, I don't want to output the lines with comma. And I also don't want to output "." or space. But I still get the lines like the following:... (8 Replies)
Discussion started by: twotwo
8 Replies
Alzabo::SQLMaker(3pm)					User Contributed Perl Documentation				     Alzabo::SQLMaker(3pm)

NAME
Alzabo::SQLMaker - Alzabo base class for RDBMS drivers SYNOPSIS
use Alzabo::SQLMaker::MySQL; my $sql = Alzabo::SQLMaker::MySQL->new( driver => $driver_object ); # or better yet my $sql = $runtime_schema->sqlmaker; DESCRIPTION
This is the base class for all Alzabo::SQLMaker modules. To instantiate a driver call this class's "new" method. See "SUBCLASSING Alz- abo::SQLMaker" for information on how to make a driver for the RDBMS of your choice. METHODS
available Returns A list of names representing the available "Alzabo::SQLMaker" subclasses. Any one of these names would be appropriate as a parame- ter for the "Alzabo::SQLMaker->load()" method. load Load the specified subclass. This takes one parameter, the name of the RDBMS being used. Throws: "Alzabo::Exception::Eval" new This takes two parameters: * driver The driver object being used by the schema. * quote_identifiers A boolean value indicating whether or not identifiers should be quoted. This defaults to false. GENERATING SQL
This class can be used to generate SQL by calling methods that are the same as those used in SQL ("select()", "update()", etc.) in sequence, with the appropriate parameters. There are four entry point methods, "select()", "insert()", "update()", and "delete()". Attempting to call any other method without first calling one of these is an error. Entry Points These methods are called as class methods and return a new object. select ("Alzabo::Table" and/or "Alzabo::Column" objects) This begins a select. The columns to be selected are the column(s) passed in, and/or the columns of the table(s) passed in as arguments. Followed by: "from()" "** function" insert Followed by: "into()" update ("Alzabo::Table") Followed by: "set()" delete Followed by: "from()" Other Methods All of these methods return the object itself, making it possible to chain together method calls such as: Alzabo::SQLMaker->select($column)->from($table)->where($other_column, '>', 2); from ("Alzabo::Table" object, ...) The table(s) from which we are selecting data. Follows: "select()" "** function" "delete()" Followed by: "where()""> "order_by()" Throws: "Alzabo::Exception::SQL" where <see below> The first parameter to where must be an "Alzabo::Column" object or SQL function. The second is a comparison operator of some sort, given as a string. The third argument can be an "Alzabo::Column" object, a value (a number or string), or an "Alzabo::SQLMaker" object. The latter is treated as a subselect. Values given as parameters will be properly quoted and escaped. Some comparison operators allow additional parameters. The "BETWEEN" comparison operator requires a fourth argument. This must be either an "Alzabo::Column" object or a value. The "IN" and <NOT IN> operators allow any number of additional parameters, which may be "Alzabo::Column" objects, values, or "Alzabo::SQL- Maker" objects. Follows: "from()" Followed by: "and()" "or()" "order_by()" Throws: "Alzabo::Exception::SQL" and (same as "where") or (same as "where") These methods take the same parameters as the "where()""> method. Follows: "where()""> "and()" "or()" Followed by: "and()" "or()" "order_by()" Throws: "Alzabo::Exception::SQL" order_by ("Alzabo::Column" objects) Adds an "ORDER BY" clause to your SQL. Follows: "from()" "where()""> "and()" "or()" Followed by: "limit()" Throws: "Alzabo::Exception::SQL" limit ($max, optional $offset) Specifies a limit on the number of rows to be returned. The offset parameter is optional. Follows: "from()" "where()""> "and()" "or()" "order_by()" "Alzabo::Exception::SQL" into ("Alzabo::Table" object, optional "Alzabo::Column" objects) Used to specify what table an insert is into. If column objects are given then it is expected that values will only be given for that object. Otherwise, it assumed that all columns will be specified in the "values()" method. Follows: "insert()" Followed by: "values()" Throws: "Alzabo::Exception::SQL" values ("Alzabo::Column" object => $value, ...) This method expects to recive an structured like a hash where the keys are "Alzabo::Column" objects and the values are the value to be inserted into that column. Follows: "into()" Throws: "Alzabo::Exception::SQL" set ("Alzabo::Column" object => $value, ...) This method'a parameter are exactly like those given to the "values" method. Follows: "update()" Followed by: "where()""> Throws: "Alzabo::Exception::SQL" RETRIEVING SQL FROM THE OBJECT
sql This method can be called at any time, though obviously it will not return valid SQL unless called at a natural end point. In the future, an exception may be thrown if called when the SQL is not in a valid state. Returns the SQL generated so far as a string. bind Returns an array reference containing the parameters to be bound to the SQL statement. SUBCLASSING Alzabo::SQLMaker To create a subclass of "Alzabo::SQLMaker" for your particular RDBMS requires only that the virtual methods listed below be implemented. In addition, you may choose to override any of the other methods described in this documentation. For example, the MySQL subclass override the "_subselect()" method because MySQL cannot support sub-selects. Subclasses are also expected to offer for export various sets of functions matching SQL functions. See the "Alzabo::SQLMaker::MySQL" sub- class implementation for details. VIRTUAL METHODS
The following methods must be implemented by the subclass: limit See above for the definition of this method. get_limit This method may return "undef" even if the "limit()" method was called. Some RDBMS's have special SQL syntax for "LIMIT" clauses. For those that don't support this, the "Alzabo::Driver" module takes a "limit" parameter. The return value of this method can be passed in as that parameter. If the RDBMS does not support "LIMIT" clauses, the return value is an array reference containing two values, the maximum number of rows allowed and the row offset (the first row that should be used). If the RDBMS does support "LIMIT" clauses, then the return value is "undef". sqlmaker_id Returns the subclass's name. This should be something that can be passed to "Alzabo::SQLMaker->load()" as a parameter. AUTHOR
Dave Rolsky, <dave@urth.org> perl v5.8.8 2007-12-23 Alzabo::SQLMaker(3pm)
All times are GMT -4. The time now is 10:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy