guys can anyone tel me how to insert a line in a file(bash) using line number
i wanna insert the line using LINE NUMBER...i know for inserting above or below a perticular line we can use sed a\ or i\....
thanks in advance.... (7 Replies)
Hi,
Suppose I have a file which contains many lines,
----------------------
wake up
study hard
play a little
getting hungry <---- insert a line after this line
watch TV
go shopping
come back home
getting hungry <--- insert a line after this line
listen music
surf internet
go to... (2 Replies)
Hi
Is there any command where we can insert a line "2|||" before every line starting with "3|"
my input is as follows
1|ETG|12345
3|79.58|||GBP||
1|ETG|12345
3|79.58|||GBP||
1|ETG|12345
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
1|ETG|12345
3|88.51|||GBP||
desired output... (10 Replies)
I have posted it previously but somehow could not delete the previous post.I felt i could not explain the problem statement well.
Here t goes.I have a file say File1. Now i need a specific pattern from the lines to be added to the other line.
File:
red blue green ABC.txt@ABC END
black... (1 Reply)
Hi All,
I am using the below script to enter the URL at the end of file:
echo "Enter the URL that should point to the particular microsite"
read url
sed "$a $url" redirects.virgin-atlantic.com.conf > temp
But am getting the below error:
./script.sh:... (7 Replies)
Friends ,
I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated.
My File
control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1
control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
Hello,
I am new to this forum. I have a question in Unix shell scripting. Here is my requirement
I have 1000 files and I need to insert a header with one line at the top of
each of the 1000 files. Please let me know if you have any solution for this
Thanks in advance.
Raj (4 Replies)
Hi..wanted a help regarding inserting a newline in an xml file using shell script.
i've an xml file which has the following data.
1. <?xml version="1.0" encoding="UTF-8"?>
2. <group>
3. <name>odcm</name>
4. contd....
I need to insert two new lines after line#2, so that the output... (14 Replies)
Hello All,
I have following file contents
cat file
#line=aaaaaa
#line=bbbbbb
#line=cccccc
#line=dddddd
line=eeeeee
#comment=11111
#comment=22222
#comment=33333
#comment=44444
comment=55555
Testing script
Good Luck!
I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Hi all,
I want ot print a header with new line in the end. I am using echo
like echo "this is header"
I want output like
This is header
$
I tried -e also but it's not working. echo - e
Can anyone help please? (6 Replies)
Discussion started by: dsa
6 Replies
LEARN ABOUT PHP
ovrimos_fetch_into
OVRIMOS_FETCH_INTO(3)OVRIMOS_FETCH_INTO(3)ovrimos_fetch_into - Fetches a row from the result setSYNOPSIS
bool ovrimos_fetch_into (int $result_id, array &$result_array, [string $how], [int $rownumber])
DESCRIPTION
Fetches a row from the given result set, into $result_array.
PARAMETERS
o $result_id
- A result identifier, returned by ovrimos_execute(3) or ovrimos_exec(3).
o $result_array
- You must provide an array by reference. It will be filled with the fetched values.
o $how
- Determines how the rows are fetched. This can be one of the following strings (case is not significant):
+---------+---------------------------------------------------+
| Option | |
| | |
| | Notes |
| | |
+---------+---------------------------------------------------+
| | |
| Next | |
| | |
| | Forward direction from current position. This is |
| | the default value. |
| | |
| | |
| Prev | |
| | |
| | Backward direction from current position. |
| | |
| | |
| First | |
| | |
| | Forward direction from the start. |
| | |
| | |
| Last | |
| | |
| | Backward direction from the end. |
| | |
| | |
|Absolute | |
| | |
| | Absolute position from the start. Requires |
| | $rownumber. |
| | |
+---------+---------------------------------------------------+
o $rownumber
- The row number, first one is 0. Only needed when $how is set to Absolute.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
A fetch into example
<?php
$conn=ovrimos_connect("neptune", "8001", "admin", "password");
if ($conn!=0) {
echo "Connection ok!";
$res=ovrimos_exec($conn, "select table_id, table_name from sys.tables");
if ($res != 0) {
echo "Statement ok!";
if (ovrimos_fetch_into($res, $row)) {
list($table_id, $table_name) = $row;
echo "table_id=" . $table_id . ", table_name=" . $table_name . "
";
if (ovrimos_fetch_into($res, $row)) {
list($table_id, $table_name) = $row;
echo "table_id=" . $table_id . ", table_name=" . $table_name . "
";
} else {
echo "Next: error
";
}
} else {
echo "First: error
";
}
ovrimos_free_result($res);
}
ovrimos_close($conn);
}
?>
SEE ALSO ovrimos_fetch_row(3).
PHP Documentation Group OVRIMOS_FETCH_INTO(3)