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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT PHP
pdostatement.bindcolumn
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)