Hi Friends,
Following is an output of a script
OPWQERIUTYKLSADFJHGXZNMCVBWQOPERIUTYKLSADFJHGXZNMCVB
I want to replace above string's 11 to 17 character by ******* (7 stars)
How can it be done?
Please somebody guide me. (6 Replies)
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Hi,
I know there are lots of threads on replacing text within files, usually using sed or awk. However, I find it hard to adapt examples that I found to my specific case. I am kind of new to UNIX and have hard times learning the syntax either for sed or awk so I would appreciate any help. Here's... (5 Replies)
Hi,
I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/... (5 Replies)
Hi,
I have two input files as
File1 :
ABC:client1:project1
XYZ:client2-aa:project2
DEF:client4:proj
File2 :
client1:W-170:xx
client2-aa:WT-04:yy
client4:L-005A:zz
Also, array of valid values can be hardcoded like
Output :
ABC:W:project1
XYZ:WT:project2 (1 Reply)
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Hi guys,
So what I am trying to accomplish is to replace a whole string starting with some designated string.
eg:
When even I find a string starting with :
eai.endpoint.url=
replace the entire line with:
eai.endpoint.url=http://www.endpoint.com/API
Righ now I am trying to... (4 Replies)
I'm new with scripting and I can't seem to figure out what I should do to get the output that I want.
My file content would be below.
ID2|ID3 |ID4|ID5 |
I'm trying to replace the field of ID3 which has a fixed length of 10 characters, for each entry I have placed on a .txt file... (5 Replies)
Discussion started by: asdfghjkl
5 Replies
LEARN ABOUT PHP
maxdb_fetch_lengths
MAXDB_FETCH_LENGTHS(3) 1 MAXDB_FETCH_LENGTHS(3)maxdb_fetch_lengths - Returns the lengths of the columns of the current row in the result set
Procedural style
SYNOPSIS
array maxdb_fetch_lengths (resource $result)
DESCRIPTION
Object oriented style
array$maxdb_result->lengths ()
The maxdb_fetch_lengths(3) function returns an array containing the lengths of every column of the current row within the result set rep-
resented by the $result parameter. If successful, a numerically indexed array representing the lengths of each column is returned or FALSE
on failure.
RETURN VALUES
An array of integers representing the size of each column (not including any terminating null characters). FALSE if an error occurred.
maxdb_fetch_lengths(3) is valid only for the current row of the result set. It returns FALSE if you call it before calling
maxdb_fetch_row/array/resource or after retrieving all rows in the result.
EXAMPLES
Example #1
Object oriented style
<?php
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
$query = "SELECT * from hotel.customer WHERE cno = 3000";
if ($result = $maxdb->query($query)) {
$row = $result->fetch_row();
/* display column lengths */
foreach ($result->lengths as $i => $val) {
printf("Field %2d has Length %2d
", $i+1, $val);
}
$result->close();
}
/* close connection */
$maxdb->close();
?>
Example #2
Procedural style
<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
$query = "SELECT * from hotel.customer WHERE cno = 3000";
if ($result = maxdb_query($link, $query)) {
$row = maxdb_fetch_row($result);
/* display column lengths */
foreach (maxdb_fetch_lengths($result) as $i => $val) {
printf("Field %2d has Length %2d
", $i+1, $val);
}
maxdb_free_result($result);
}
/* close connection */
maxdb_close($link);
?>
The above example will output something similar to:
Field 1 has Length 4
Field 2 has Length 3
Field 3 has Length 5
Field 4 has Length 6
Field 5 has Length 5
Field 6 has Length 21
PHP Documentation Group MAXDB_FETCH_LENGTHS(3)