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_GET_IMPLICIT_RESULTSET(3)											     OCI_GET_IMPLICIT_RESULTSET(3)

oci_get_implicit_resultset  -  Returns	the  next  child statement resource from a parent statement resource that has Oracle Database 12c Implicit
Result Sets

SYNOPSIS
resource oci_get_implicit_resultset (resource $statement) DESCRIPTION
Used to fetch consectutive sets of query results after the execution of a stored or anonymous Oracle PL/SQL block where that block returns query results with Oracle's DBMS_SQL.RETURN_RESULT PL/SQL function. This allows PL/SQL blocks to easily return query results. The child statement can be used with any of the OCI8 fetching functions: oci_fetch(3), oci_fetch_all(3), oci_fetch_array(3), oci_fetch_object(3), oci_fetch_assoc(3) or oci_fetch_row(3) Child statements inherit their parent statement's prefetch value, or it can be explicitly set with oci_set_prefetch(3). PARAMETERS
o $statement -A valid OCI8 statement identifier created by oci_parse(3) and executed by oci_execute(3). The statement identifier may or may not be associated with a SQL statement that returns Implicit Result Sets. RETURN VALUES
Returns a statement handle for the next child statement available on $statement. Returns FALSE when child statements do not exist, or all child statements have been returned by previous calls to oci_get_implicit_resultset(3). EXAMPLES
Example #1 Fetching Implicit Result Sets in a loop <?php $conn = oci_connect('hr', 'welcome', 'localhost/pdborcl'); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } $sql = 'DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT city, postal_code FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); OPEN c1 FOR SELECT country_id FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); END;'; $stid = oci_parse($conn, $sql); oci_execute($stid); while (($stid_c = oci_get_implicit_resultset($stid))) { echo "<h2>New Implicit Result Set:</h2> "; echo "<table> "; while (($row = oci_fetch_array($stid_c, OCI_ASSOC+OCI_RETURN_NULLS)) != false) { echo "<tr> "; foreach ($row as $item) { echo " <td>".($item!==null?htmlentities($item, ENT_QUOTES|ENT_SUBSTITUTE):"&nbsp;")."</td> "; } echo "</tr> "; } echo "</table> "; } // Output is: // New Implicit Result Set: // Beijing 190518 // Bern 3095 // Bombay 490231 // New Implicit Result Set: // CN // CH // IN oci_free_statement($stid); oci_close($conn); ?> Example #2 Getting child statement handles individually <?php $conn = oci_connect('hr', 'welcome', 'localhost/pdborcl'); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } $sql = 'DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT city, postal_code FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); OPEN c1 FOR SELECT country_id FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); END;'; $stid = oci_parse($conn, $sql); oci_execute($stid); $stid_1 = oci_get_implicit_resultset($stid); $stid_2 = oci_get_implicit_resultset($stid); $row = oci_fetch_array($stid_1, OCI_ASSOC+OCI_RETURN_NULLS); var_dump($row); $row = oci_fetch_array($stid_2, OCI_ASSOC+OCI_RETURN_NULLS); var_dump($row); $row = oci_fetch_array($stid_1, OCI_ASSOC+OCI_RETURN_NULLS); var_dump($row); $row = oci_fetch_array($stid_2, OCI_ASSOC+OCI_RETURN_NULLS); var_dump($row); // Output is: // array(2) { // ["CITY"]=> // string(7) "Beijing" // ["POSTAL_CODE"]=> // string(6) "190518" // } // array(1) { // ["COUNTRY_ID"]=> // string(2) "CN" // } // array(2) { // ["CITY"]=> // string(4) "Bern" // ["POSTAL_CODE"]=> // string(4) "3095" // } // array(1) { // ["COUNTRY_ID"]=> // string(2) "CH" // } oci_free_statement($stid); oci_close($conn); ?> Example #3 Explicitly setting the Prefetch Count <?php $conn = oci_connect('hr', 'welcome', 'localhost/pdborcl'); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } $sql = 'DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT city, postal_code FROM locations ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); END;'; $stid = oci_parse($conn, $sql); oci_execute($stid); $stid_c = oci_get_implicit_resultset($stid); oci_set_prefetch($stid_c, 200); // Set the prefetch before fetching from the child statement echo "<table> "; while (($row = oci_fetch_array($stid_c, OCI_ASSOC+OCI_RETURN_NULLS)) != false) { echo "<tr> "; foreach ($row as $item) { echo " <td>".($item!==null?htmlentities($item, ENT_QUOTES|ENT_SUBSTITUTE):"&nbsp;")."</td> "; } echo "</tr> "; } echo "</table> "; oci_free_statement($stid); oci_close($conn); ?> Example #4 Implicit Result Set example without using oci_get_implicit_resultset(3) All results from all queries are returned consecutively. <?php $conn = oci_connect('hr', 'welcome', 'localhost/pdborcl'); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } $sql = 'DECLARE c1 SYS_REFCURSOR; BEGIN OPEN c1 FOR SELECT city, postal_code FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); OPEN c1 FOR SELECT country_id FROM locations WHERE ROWNUM < 4 ORDER BY city; DBMS_SQL.RETURN_RESULT(c1); END;'; $stid = oci_parse($conn, $sql); oci_execute($stid); // Note: oci_fetch_all and oci_fetch() cannot be used in this manner echo "<table> "; while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) != false) { echo "<tr> "; foreach ($row as $item) { echo " <td>".($item!==null?htmlentities($item, ENT_QUOTES|ENT_SUBSTITUTE):"&nbsp;")."</td> "; } echo "</tr> "; } echo "</table> "; // Output is: // Beijing 190518 // Bern 3095 // Bombay 490231 // CN // CH // IN oci_free_statement($stid); oci_close($conn); ?> NOTES
Note For queries returning a large number of rows, performance can be significantly improved by increasing oci8.default_prefetch or using oci_set_prefetch(3). PHP Documentation Group OCI_GET_IMPLICIT_RESULTSET(3)
All times are GMT -4. The time now is 10:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy