I have an array containing bunch of characters. I have to check this array for specific character and if "Not Found than" use a goto statement to go to USAGE
In above code I am looking for F and D and if not found than script goes to USAGE defined somewhere in script. I know it can be done with awk/sed/grep as one liner which I think more efficient. I am new to this and want to move away from doing things in an ancient way. Please help.
Thanks in advance
We have the following statement working in CGYWIN, but when we move the program to Solaris 10 it fails.
x=`echo "ABC196925XYZ" | grep -o --only-matching "\{6\}"`
How can we use AWK or SED to extract only the number from the string?
The following outputs the entire string. We only want... (5 Replies)
Hi friends,
Could you please help me to resolve the below issue.
Input file :-
<Node>
<username>abc</username>
<password>ABC</password>
<Node>
<Node>
<username>xyz</username>
<password>XYZ</password>
<Node>
<Node>
<username>mnp</username>
... (3 Replies)
Hi,
I want to search for patterns (from a file) in a file and print the line matching the patterns and the line before it.
I have to search for 100s of patterns from a file.
Any help with AWK or Sed.
Thanks! (2 Replies)
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Hello All,
I have a file which is having below type of data,
Jul 19 2011 | 123456
Jul 19 2011 | 123456
Jul 20 2011 | 123456
Jul 20 2011 | 123456
Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period.
Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Hi,
I need a help to search a pattern and print the multiple lines between them.
Input file:
Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Hi ,
I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows.
# diff mir_lex.c.modified mir_lex.c.orig
3209c3209
< if(yy_current_buffer -> yy_is_our_buffer == 0) {
---
>... (5 Replies)
I have this fileA
TEST FILE ABC
this file contains ABC;
TEST FILE DGHT this file contains DGHT;
TEST FILE 123
this file contains ABC,
this file contains DEF,
this file contains XYZ,
this file contains KLM
;
I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
LEARN ABOUT PHP
pdo.errorinfo
PDO.ERRORINFO(3) 1 PDO.ERRORINFO(3)PDO ::errorInfo - Fetch extended error information associated with the last operation on the database handle
SYNOPSIS
public array PDO::errorInfo (void )
DESCRIPTION RETURN VALUES PDO.errorInfo(3) returns an array of error information about the last operation performed by this database handle. The array consists of
the following fields:
+--------+---------------------------------------------------+
|Element | |
| | |
| | Information |
| | |
+--------+---------------------------------------------------+
| 0 | |
| | |
| | SQLSTATE error code (a five characters alphanu- |
| | meric identifier defined in the ANSI SQL stan- |
| | dard). |
| | |
| 1 | |
| | |
| | Driver-specific error code. |
| | |
| 2 | |
| | |
| | Driver-specific error message. |
| | |
+--------+---------------------------------------------------+
Note
If the SQLSTATE error code is not set or there is no driver-specific error, the elements following element 0 will be set to NULL.
PDO.errorInfo(3) only retrieves error information for operations performed directly on the database handle. If you create a PDOStatement
object through PDO.prepare(3) or PDO.query(3) and invoke an error on the statement handle, PDO.errorInfo(3) will not reflect the error from
the statement handle. You must call PDOStatement.errorInfo(3) to return the error information for an operation performed on a particular
statement handle.
EXAMPLES
Example #1
Displaying errorInfo() fields for a PDO_ODBC connection to a DB2 database
<?php
/* Provoke an error -- bogus SQL syntax */
$stmt = $dbh->prepare('bogus sql');
if (!$stmt) {
echo "
PDO::errorInfo():
";
print_r($dbh->errorInfo());
}
?>
The above example will output:
PDO::errorInfo():
Array
(
[0] => HY000
[1] => 1
[2] => near "bogus": syntax error
)
SEE ALSO PDO.errorCode(3), PDOStatement.errorCode(3), PDOStatement.errorInfo(3).
PHP Documentation Group PDO.ERRORINFO(3)