Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
I have a file that will sometimes contain a pattern. The pattern is this:
W/D FRM CHK 00
I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (1 Reply)
I have a file that will sometimes contain a pattern. The pattern is this:
FRM CHK 0000
I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below. (4 Replies)
I am trying to delete the line with pattern and the next line. Found the below command in forum which also deleted the previous line. how should i modify that to make sure that only the line with pattern and the next line are deleted but not the previous line?
awk '/key... (1 Reply)
Hi,
Before insert, delete everything. If ' available before insert, then we need to keep this.
Input:
====
l_s := ' INSERT INTO TEST1'
INSERT INTO TEST2
Output:
====
'INSERT INTO TEST'
INSERT INTO TEST2 (2 Replies)
if the given pattern exists in the file with the very next line starting and ending
with the same pattern , delete the line that starts and ends with the given pattern.
So upon running on this file
=====================
hai people<PATTERN> we had
<PATTERN>a lot of fun<PATTERN>
... (1 Reply)
if the given pattern exists in the file with the very next line starting and ending
with the same pattern , delete the line that starts and ends with the given pattern.
So upon running on this file
=====================
hai people<PATTERN> we had
<PATTERN>a lot of fun<PATTERN>
... (1 Reply)
How to delete the next lines of the below pattern matches a certain criteria using sed
it is rainy heavily<name>
<name> how is it there <name>
gfhafje
qwfwfqw
eeqewqrt
<name>
there is heavy raining <name>
so that the output will be
it is rainy heavily<name>
gfhafje
qwfwfqw... (2 Replies)
Hi all,
I'm trying to delete line contains pattern from file using ex editor
I have tried something like this
user@host ~ $/usr/bin/echo "/$pattern/d\nwq!"| /usr/bin/ex -s file.txt
This line is from script
but it doesn't work
any idea (4 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
LEARN ABOUT PHP
sqlsrv_rows_affected
SQLSRV_ROWS_AFFECTED(3)SQLSRV_ROWS_AFFECTED(3)sqlsrv_rows_affected - Returns the number of rows modified by the last INSERT, UPDATE, or DELETE query executedSYNOPSIS
int sqlsrv_rows_affected (resource $stmt)
DESCRIPTION
Returns the number of rows modified by the last INSERT, UPDATE, or DELETE query executed. For information about the number of rows
returned by a SELECT query, see sqlsrv_num_rows(3).
PARAMETERS
o $stmt
- The executed statement resource for which the number of affected rows is returned.
RETURN VALUES
Returns the number of rows affected by the last INSERT, UPDATE, or DELETE query. If no rows were affected, 0 is returned. If the number of
affected rows cannot be determined, -1 is returned. If an error occurred, FALSE is returned.
EXAMPLES
Example #1
sqlsrv_rows_affected(3) example
<?php
$serverName = "serverNamesqlexpress";
$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password" );
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
$sql = "UPDATE Table_1 SET data = ? WHERE id = ?";
$params = array("updated data", 1);
$stmt = sqlsrv_query( $conn, $sql, $params);
$rows_affected = sqlsrv_rows_affected( $stmt);
if( $rows_affected === false) {
die( print_r( sqlsrv_errors(), true));
} elseif( $rows_affected == -1) {
echo "No information available.<br />";
} else {
echo $rows_affected." rows were updated.<br />";
}
?>
SEE ALSO sqlsrv_num_rows(3).
PHP Documentation Group SQLSRV_ROWS_AFFECTED(3)