Sponsored Content
Top Forums Shell Programming and Scripting Getting data from a flat file based on condition Post 302885792 by Vivekit82 on Tuesday 28th of January 2014 12:08:13 PM
Old 01-28-2014
not working..
I want to work as below.
Suppose there are 3 rows in files and clumn 6 and 7 have below values.
Code:
 
00
00
00

Except above case mail should come in all the cases.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting a flat file based on multiple colums(using character position)

Hi, I have an urgent task here. I am required to sort a flat file based on multiple columns which are based on the character position in that line. I am restricted to use the character position instead of the space and sort +1 +2 etc to do the sorting. I understand that there is a previous... (8 Replies)
Discussion started by: cucubird
8 Replies

2. Shell Programming and Scripting

Merge lines in Flat file based on first 5 characters

Hi I have the fixed width flat file having the following data 12345aaaaaaaaaabbbbbbbbbb 12365sssssssssscccccccccc 12365sssss 12367ddddddddddvvvvvvvvvv 12367 vvvvv Here the first column is length 5 second is length 10 third is length 10 if the second or third column exceeds... (3 Replies)
Discussion started by: Brado
3 Replies

3. Shell Programming and Scripting

Shell script to email based on flat file output

Hi All, I am a newbee in unix but still have written a shell script which should trigger a mail based on certain conditions but the problem is that my file is not being read. Below is the code please advise. I do not know where is it failing. Note $ and the no followed with it is the no of... (1 Reply)
Discussion started by: apoorva
1 Replies

4. Shell Programming and Scripting

Load data from a flat file to oracle.

I have a flat file with records like Header 123 James Williams Finance2000 124 Pete Pete HR 1500 125 PatrickHeather Engg 3000 Footer The structure is: Eno:4 characters Name:8 characters Surname : 9 characters Dept:7 characters Sal:4characters These are sample... (1 Reply)
Discussion started by: Shivdatta
1 Replies

5. UNIX for Dummies Questions & Answers

Normalize Data and write to a flat file

All, Can anyone please help me with the below scenario. I have a Flat file of the below format. ID|Name|Level|Type|Zip|MAD|Risk|Band|Salesl|Dealer|CID|AType|CValue|LV|HV|DCode|TR|DU|NStartDate|UserRole|WFlag|EOption|PName|NActivationDate|Os|Orig|Cus|OType|ORequired|DType 03|... (10 Replies)
Discussion started by: sp999
10 Replies

6. Shell Programming and Scripting

To read a flat file containing XML data

I have a file something like this:aaaa.xml content of the file is 0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s> <BRANCH_NO>3061</BRANCH_NO> <BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME> ... (4 Replies)
Discussion started by: kmanivan82
4 Replies

7. UNIX for Dummies Questions & Answers

Deleting the unwanted data based on condition

hi i have my input data like this aaa bbb ccc asa dff nmj mnj saa dff oik aax cdx saa oik asq sdf dssi want my output file to be like this mnj saa dff oik aax cdx saa oiki want to retain only those lines which will have oik just below them and i want oik to be as next column to those... (1 Reply)
Discussion started by: anurupa777
1 Replies

8. Shell Programming and Scripting

Sort based on positions in flat file

Hello, For example: 12........6789101112..............20212223242526..................50 ( Positions) LName FName DOB (Lastname starts from 1 to 6 , FName from 8 to 15 and date of birth from 21 to29) CURTIS KENNETH ... (5 Replies)
Discussion started by: duplicate
5 Replies

9. Shell Programming and Scripting

Dynamically prepare the condition using flat file sdata

I have a file in which the data looks like A,B My output should be T1.A=T2.A AND T1.B=T2.B If my input is A,B,C My output should be T1.A=T2.A AND T1.B=T2.B AND T1.C=T2.C Currently I am automating my databae script and strucked with this part.Not able to search the... (2 Replies)
Discussion started by: bikky6
2 Replies

10. Shell Programming and Scripting

Adding data from a file based on some condition

I collect data in a file in below format(Month Day Year Size) in RedHat Linux. Now i want to calculate the data size date wise. As i code shell script after long time, i forgot the features and syntax. Can anyone help me regard this please. Feb 8 2014 15 Feb 10 2014 32 Feb 10 2014 32 Feb 12... (2 Replies)
Discussion started by: makauser
2 Replies
PDOSTATEMENT.BINDCOLUMN(3)						 1						PDOSTATEMENT.BINDCOLUMN(3)

PDOStatement::bindColumn - Bind a column to a PHP variable

SYNOPSIS
public bool PDOStatement::bindColumn (mixed $column, mixed &$param, [int $type], [int $maxlen], [mixed $driverdata]) DESCRIPTION
PDOStatement.bindColumn(3) arranges to have a particular variable bound to a given column in the result-set from a query. Each call to PDOStatement.fetch(3) or PDOStatement.fetchAll(3) will update all the variables that are bound to columns. Note Since information about the columns is not always available to PDO until the statement is executed, portable applications should call this function afterPDOStatement.execute(3). However, to be able to bind a LOB column as a stream when using the PgSQL driver, applications should call this method before call- ing PDOStatement.execute(3), otherwise the large object OID will be returned as an integer. PARAMETERS
o $column - Number of the column (1-indexed) or name of the column in the result set. If using the column name, be aware that the name should match the case of the column, as returned by the driver. o $param - Name of the PHP variable to which the column will be bound. o $type - Data type of the parameter, specified by the PDO::PARAM_* constants. o $maxlen - A hint for pre-allocation. o $driverdata - Optional parameter(s) for the driver. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Binding result set output to PHP variables Binding columns in the result set to PHP variables is an effective way to make the data contained in each row immediately available to your application. The following example demonstrates how PDO allows you to bind and retrieve columns with a variety of options and with intelligent defaults. <?php function readData($dbh) { $sql = 'SELECT name, colour, calories FROM fruit'; try { $stmt = $dbh->prepare($sql); $stmt->execute(); /* Bind by column number */ $stmt->bindColumn(1, $name); $stmt->bindColumn(2, $colour); /* Bind by column name */ $stmt->bindColumn('calories', $cals); while ($row = $stmt->fetch(PDO::FETCH_BOUND)) { $data = $name . " " . $colour . " " . $cals . " "; print $data; } } catch (PDOException $e) { print $e->getMessage(); } } readData($dbh); ?> The above example will output: apple red 150 banana yellow 175 kiwi green 75 orange orange 150 mango red 200 strawberry red 25 SEE ALSO
PDOStatement.execute(3), PDOStatement.fetch(3), PDOStatement.fetchAll(3), PDOStatement.fetchColumn(3). PHP Documentation Group PDOSTATEMENT.BINDCOLUMN(3)
All times are GMT -4. The time now is 05:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy