Sponsored Content
Top Forums Shell Programming and Scripting Search and Replace text in folders and Subfolders Post 302506613 by Asheesh on Monday 21st of March 2011 11:27:16 AM
Old 03-21-2011
I have to replace &nbsp with &|nbsp and I am using the folloing command

sed -e "s/&nbsp/&|nbsp/g"

But this replace &nbsp with &nbsp|nbsp...what should i do to get the desired results...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create folders/subfolders using shellscript

Hi, Can any one help me how to create folders using shellscript.My requirement is: FolderName: Main/Main1 :Main/Main2 :Main/Main3 underSubFolder : Main1/A :Main1/B :Main1/C underSubfolder: A/A1 ... (2 Replies)
Discussion started by: ram2s2001
2 Replies

2. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

3. Shell Programming and Scripting

Script to Analyze folders and subfolders

I would like to know if there is a script out there that someone may have already written that I can use to analyze folders and sub folders on my AIX system. It can be in perl or a basic korn script. Thanks in advance. (7 Replies)
Discussion started by: seacros
7 Replies

4. UNIX for Advanced & Expert Users

find size of folders and its subfolders with the Owner details

HI, I have the following command that shows me the total size of folders and subfolders : du -hs *| sort -n result: 1.0M sandeep 1.4G sandy 1.4M important 1.6M files but I will need to know the size of folders and its subfolders( not size of individual files though)... (5 Replies)
Discussion started by: bsandeep_80
5 Replies

5. Windows & DOS: Issues & Discussions

Copy folders and subfolders from unix to windows

Sir From a unix machine some folders and their folders have to be copied to windows XP PC. Please help me with a batch file or a shell script. I am new to the the shell and batch files. Thanks in anticipation. sastry (3 Replies)
Discussion started by: chssastry
3 Replies

6. Shell Programming and Scripting

Help to move folders, subfolders and files from unix to windows

Hi Unix Gurus, I am able to copy only files that exist in the parent folder. My parent folder has sub folders and within sub folders there are lots files. I need to copy folder, sub folders and files from Unix to the remote windows SFTP location. The directory structure is something like... (1 Reply)
Discussion started by: shankar1dada
1 Replies

7. Shell Programming and Scripting

search data from text file in different folders

I am fairly new to unix scripting, the problem is i can understand the unix script. but i fail to write. I do not know where to start and how to end. I am sure this forum will help to achive my dream scriptings in unix. Thanks in adv for your help. Here I need.. I have list of columns in one... (2 Replies)
Discussion started by: dsnrhdy
2 Replies

8. Shell Programming and Scripting

Creating matrix from folders and subfolders

Hello, Greetings! please help me produce the following solution. I need to produce one big matrix file from several files in different levels. If it helps, the index folder provides information on chromosome index and the data folder provides information on values for chromosomes. there... (8 Replies)
Discussion started by: newbie83
8 Replies

9. Shell Programming and Scripting

Move specific folders and subfolders in a directory

I am trying to move specific folders and subfolders within a directory using the below. I can see the folders to move and they are at the location, but I am getting an error. Thank you :). mv -v /home/cmccabe/Desktop/NGS/API/6-10-2016{bam/{validation,coverage},bedtools /media/cmccabe/"My... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. UNIX for Beginners Questions & Answers

Command to change add permissions for a new user to all files in all subfolders and folders

Hi there! I'm new to Unix and haven't done command line stuff since MS-Dos and Turbo Pascal (hah!), I would love some help figuring out this basic command (what I assume is basic). I'd like to add a User to the permissions of all files in a folder and all files in all subfolders, as well... (9 Replies)
Discussion started by: Janjbrt
9 Replies
OCI_SET_PREFETCH(3)													       OCI_SET_PREFETCH(3)

oci_set_prefetch - Sets number of rows to be prefetched by queries

SYNOPSIS
bool oci_set_prefetch (resource $statement, int $rows) DESCRIPTION
Sets the number of rows to be buffered by the Oracle Client libraries after a successful query call to oci_execute(3) and for each subse- quent internal fetch request to the database. For queries returning a large number of rows, performance can be significantly improved by increasing the prefetch count above the default oci8.default_prefetch value. Prefetching is Oracle's efficient way of returning more than one data row from the database in each network request. This can result in better network and CPU utilization. The buffering of rows is internal to OCI8 and the behavior of OCI8 fetching functions is unchanged regardless of the prefetch count. For example, oci_fetch_row(3) will always return one row. The prefetch buffer is per-statement and is not used by re-executed statements or by other connections. Call oci_set_prefetch(3) before calling oci_execute(3). A tuning goal is to set the prefetch value to a reasonable size for the network and database to handle. For queries returning a very large number of rows, overall system efficiency might be better if rows are retrieved from the database in several chunks (i.e set the prefetch value smaller than the number of rows). This allows the database to handle other users' statements while the PHP script is processing the current set of rows. Query prefetching was introduced in Oracle 8 i. REF CURSOR prefetching was introduced in Oracle 11 gR2 and occurs when PHP is linked with Oracle 11 gR2 (or later) Client libraries. Nested cursor prefetching was introduced in Oracle 11 gR2 and requires both the Oracle Client libraries and the database to be version 11 gR2 or greater. Prefetching is not supported when queries contain LONG or LOB columns. The prefetch value is ignored and single-row fetches will be used in all the situations when prefetching is not supported. When using Oracle Database 12 c, the prefetch value set by PHP can be overridden by Oracle's client oraaccess.xml configuration file. Refer to Oracle documentation for more detail. PARAMETERS
o $statement -A valid OCI8 statement identifier created by oci_parse(3) and executed by oci_execute(3), or a REF CURSOR statement identifier. o $rows - The number of rows to be prefetched, >= 0 RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+------------------------+---------------------------------------------------+ | Version | | | | | | | Description | | | | +------------------------+---------------------------------------------------+ | 5.3.2 (PECL OCI8 1.4) | | | | | | | Before this release, $rows must be >= 1. | | | | |5.3.0 (PECL OCI8 1.3.4) | | | | | | | Before this release, prefetching was limited to | | | the lesser of $rows rows and 1024 * $rows bytes. | | | The byte size restriction has now been removed. | | | | +------------------------+---------------------------------------------------+ EXAMPLES
Example #1 Changing the default prefetch value for a query <?php $conn = oci_connect('hr', 'welcome', 'localhost/XE'); $stid = oci_parse($conn, 'SELECT * FROM myverybigtable'); oci_set_prefetch($stid, 300); // Set before calling oci_execute() oci_execute($stid); echo "<table border='1'> "; while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) { echo "<tr> "; foreach ($row as $item) { echo " <td>".($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;")."</td> "; } echo "</tr> "; } echo "</table> "; oci_free_statement($stid); oci_close($conn); ?> Example #2 Changing the default prefetch for a REF CURSOR fetch <?php /* Create the PL/SQL stored procedure as: CREATE OR REPLACE PROCEDURE myproc(p1 OUT SYS_REFCURSOR) AS BEGIN OPEN p1 FOR SELECT * FROM all_objects WHERE ROWNUM < 5000; END; */ $conn = oci_connect('hr', 'welcome', 'localhost/XE'); $stid = oci_parse($conn, 'BEGIN myproc(:rc); END;'); $refcur = oci_new_cursor($conn); oci_bind_by_name($stid, ':rc', $refcur, -1, OCI_B_CURSOR); oci_execute($stid); // Change the prefetch before executing the cursor. // REF CURSOR prefetching works when PHP is linked with Oracle 11gR2 or later Client libraries oci_set_prefetch($refcur, 200); oci_execute($refcur); echo "<table border='1'> "; while ($row = oci_fetch_array($refcur, OCI_ASSOC+OCI_RETURN_NULLS)) { echo "<tr> "; foreach ($row as $item) { echo " <td>".($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;")."</td> "; } echo "</tr> "; } echo "</table> "; oci_free_statement($refcur); oci_free_statement($stid); oci_close($conn); ?> If PHP OCI8 fetches from a REF CURSOR and then passes the REF CURSOR back to a second PL/SQL procedure for further processing, then set the REF CURSOR prefetch count to 0 to avoid rows being "lost" from the result set. The prefetch value is the number of extra rows fetched in each OCI8 internal request to the database, so setting it to 0 means only fetch one row at a time. Example #3 Setting the prefetch value when passing a REF CURSOR back to Oracle <?php $conn = oci_connect('hr', 'welcome', 'localhost/orcl'); // get the REF CURSOR $stid = oci_parse($conn, 'BEGIN myproc(:rc_out); END;'); $refcur = oci_new_cursor($conn); oci_bind_by_name($stid, ':rc_out', $refcur, -1, OCI_B_CURSOR); oci_execute($stid); // Display two rows, but don't prefetch any extra rows otherwise // those extra rows would not be passed back to myproc_use_rc(). // A prefetch value of 0 is allowed in PHP 5.3.2 and PECL OCI8 1.4 oci_set_prefetch($refcur, 0); oci_execute($refcur); $row = oci_fetch_array($refcur); var_dump($row); $row = oci_fetch_array($refcur); var_dump($row); // pass the REF CURSOR to myproc_use_rc() to do more data processing // with the result set $stid = oci_parse($conn, 'begin myproc_use_rc(:rc_in); end;'); oci_bind_by_name($stid, ':rc_in', $refcur, -1, OCI_B_CURSOR); oci_execute($stid); ?> SEE ALSO
oci8.default_prefetch ini option . PHP Documentation Group OCI_SET_PREFETCH(3)
All times are GMT -4. The time now is 10:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy