05-05-2011
thanks for your solutions. How to store the col2 to col n-1 in a variable
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear friends,
I have a pipe delimited file having 5 columns.
However the column no-3 is having extra new line characters as the data owing to owing , I am having issues.
Ideally my file should have only newline termination at the end of each record and not within column data of any of... (1 Reply)
Discussion started by: sureshg_sampat
1 Replies
2. Shell Programming and Scripting
Folks:
I have a file which has 3 columns. Using awk I want to remove rows from column 3 (Col3 <> A) where it is not equal to A. All columns are seperated by "|".
Col1|Col2|Col3|Col4
1 | 2 | A | 4
2 | 3 | A | 5
3 | 4 | B | 6
4 | 5 | A | 7
5 | 6 | ... (3 Replies)
Discussion started by: pr2003
3 Replies
3. Shell Programming and Scripting
Hello,
I've never used awk before, but from what I've read, it will best suit what I'm trying to do. I have 2 files. I need to replace strings in file1 with the first column of a matching string in file2. Below are examples:
File1:
random-string1
1112
1232
3213
2131
random-string2... (7 Replies)
Discussion started by: upstate_boy
7 Replies
4. Shell Programming and Scripting
Hi All,
My requirement is to remove line (3 Replies)
Discussion started by: r_t_1601
3 Replies
5. Shell Programming and Scripting
Hi All,
i have a csv file .
In the 7th column i have data that has line feed in it.
Requirement is to remove the line feed from the 7th column whenever it appears
There are 11 columns in the file
C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11
The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
Discussion started by: r_t_1601
2 Replies
6. Shell Programming and Scripting
Input File
science maths
tom 2 3
peter 5
rodger 5 7
Desired Ouput
science maths
tom 2 3
rodger 5 7
Here Peter does not have any value for column Science, how can we delete Peter's row.
assuming this is abc.txt file; and am using bash... (8 Replies)
Discussion started by: vishalgoyal
8 Replies
7. Shell Programming and Scripting
Hi,
I am a newbie to shell scripting (.sh). Please guide me on how to do the below issue.
My input file has below data.
I want to remove $ sysmbol from the fourth column of each line. (ie, between 4th and 5th pipe symbol)
ABC25160|51497|06/02/2010|$32,192.07|MARK|$100|A... (3 Replies)
Discussion started by: rsreejithmenon
3 Replies
8. Shell Programming and Scripting
Good day all.
Using basic UNIX/Linux tools, how would you delete a line based on a character found in column 1?
For example, if the CITY name contains an 'a' or 'A', delete the line:
New York City; New York
Los Angeles; California
Chicago; Illinois
Houston; Texas
Philadelphia;... (3 Replies)
Discussion started by: BRH
3 Replies
9. Shell Programming and Scripting
cat input.txt
a x
b y
c z
Expected output
x
y
z (11 Replies)
Discussion started by: cola
11 Replies
10. Shell Programming and Scripting
Hi Experts,
I have csv file with 30, 40 columns
Pasting just 2 column for problem description.
Need to print error if below combination is not present in file
check for column-1 (DocumentNumber) and filter columns where value in DocumentNumber field is same.
For all such rows, the field... (7 Replies)
Discussion started by: as7951
7 Replies
LEARN ABOUT PHP
maxdb_stmt_bind_result
MAXDB_STMT_BIND_RESULT(3) 1 MAXDB_STMT_BIND_RESULT(3)
maxdb_stmt_bind_result - Binds variables to a prepared statement for result storage
Procedural style
SYNOPSIS
bool maxdb_stmt_bind_result (resource $stmt, mixed &$var1, [mixed &$...])
DESCRIPTION
Object oriented style
bool maxdb_stmt::bind_result (mixed &$var1, [mixed &$...])
maxdb_stmt_bind_result(3) is used to associate (bind) columns in the result set to variables. When maxdb_stmt_fetch(3) is called to fetch
data, the MaxDB client/server protocol places the data for the bound columns into the specified variables $var1, ....
Note
Note that all columns must be bound prior to calling maxdb_stmt_fetch(3). Depending on column types bound variables can silently
change to the corresponding PHP type.
A column can be bound or rebound at any time, even after a result set has been partially retrieved. The new binding takes effect
the next time maxdb_stmt_fetch(3) is called.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Object oriented style
<?php
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
/* prepare statement */
if ($stmt = $maxdb->prepare("SELECT zip, name FROM hotel.city ORDER BY name")) {
$stmt->execute();
/* bind variables to prepared statement */
$stmt->bind_result($col1, $col2);
/* fetch values */
while ($stmt->fetch()) {
printf("%s %s
", $col1, $col2);
}
/* close statement */
$stmt->close();
}
/* close connection */
$maxdb->close();
?>
Example #2
Procedural style
<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (!$link) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
/* prepare statement */
if ($stmt = maxdb_prepare($link, "SELECT zip, name FROM hotel.city ORDER BY name")) {
maxdb_stmt_execute($stmt);
/* bind variables to prepared statement */
maxdb_stmt_bind_result($stmt, $col1, $col2);
/* fetch values */
while (maxdb_stmt_fetch($stmt)) {
printf("%s %s
", $col1, $col2);
}
/* close statement */
maxdb_stmt_close($stmt);
}
/* close connection */
maxdb_close($link);
?>
The above example will output something similar to:
12203 Albany
60601 Chicago
60615 Chicago
45211 Cincinnati
33575 Clearwater
75243 Dallas
32018 Daytona Beach
33441 Deerfield Beach
48226 Detroit
90029 Hollywood
92714 Irvine
90804 Long Beach
11788 Long Island
90018 Los Angeles
70112 New Orleans
10019 New York
10580 New York
92262 Palm Springs
97213 Portland
60018 Rosemont
95054 Santa Clara
20903 Silver Spring
20005 Washington
20019 Washington
20037 Washington
SEE ALSO
maxdb_stmt_bind_param(3), maxdb_stmt_execute(3), maxdb_stmt_fetch(3), maxdb_prepare(3), maxdb_stmt_prepare(3), maxdb_stmt_init(3),
maxdb_stmt_errno(3), maxdb_stmt_error(3).
PHP Documentation Group MAXDB_STMT_BIND_RESULT(3)