Actually, in this case, the number of lines will be arbitrary. I think I might have to number the rows first and tell the script the number of rows I need to add to a specific line. For example, I may want to add two lines to row 3 but 6 lines to row 4 and 8 lines to row 1. You get the idea.
By the way, I keep getting this error message when I run your script.
"
"
---------- Post updated at 08:29 PM ---------- Previous update was at 07:22 PM ----------
Jim, I got closer by using this script:
This script copies each line twice. This is not I really want. I need to figure out now how to tell the script the number of times I want to copy a specific row.
Let me know if you have any suggestions.
Thanks!
Last edited by Scott; 05-15-2010 at 10:33 PM..
Reason: Code tags, please...
Hi
I have few files. For some files the cursor is at the end of last line. For other files, cursor is at the new line at the end.
I want to bring the cursor down to next line for the files that are having cursor at the end of last line
In otherwords, I want to introduce a blank line at the... (5 Replies)
I'm new to shell scripting, and need to add a series of commands to the ends of certain lines of text that contain a keyword. Any easy way to do this? Thanks (2 Replies)
Hi all,
using VI, can anyone tell me how to add some characters onto the end of a line where the line begins with certain charactars eg
a,b,c,.......,
r,s,t,........,
a,b,c,.......,
all lines in the above example starting with a,b,c, I want to add an x at the end of the line so the... (6 Replies)
Hi all,
I have this sample file (actual file is larger) and i need to add comma at the end of every line.
1234
4335
232345
1212
3535
Output
1234,
4335,
232345,
1212,
3535,
TIA - jak (2 Replies)
I trying to make a simple script to get info from remote servers my problem is the output of this line-
SERVER_NAME=`ssh -t $USER@$REMOTESERVER 'hostname'`the output is
linux1^M
I would like to remove the ^M
where is my error?
Many Thanks
-Steve (1 Reply)
Hello Everyone,
I need a help from experts of this community regarding one of the issue that I am facing with shell scripting.
My requirement is to append char's at the end of each line of a file. The char that will be appended is variable and will be passed through command line.
The... (20 Replies)
Hi,
I have a script which I need to change. I want to add a semicolon at the end of each line where the line starts with "grant"
for e.g.
create table(....
);
grant select on TABL1 to USER1
grant select on TABL1 to USER2should become
create table(....
);
grant select on TABL1 to... (3 Replies)
I started venturing in learning the art of using AWK/GAWK and wanted to simply added a period from line #11 to line #28 or to the end of the file if there is data. So for example:
11 Centos.NM
12 dojo1
13 redhat.5.5.32Bit
14 redhat.6.2.64Bit... (5 Replies)
I have a file with dates as
'2013-01-01'
'2013-01-02'
I want the output to be '2013-01-01','2013-01-02'
if there is only 1 entry then there should not be any comma. (6 Replies)
Discussion started by: ATWC
6 Replies
LEARN ABOUT PHP
pg_num_rows
PG_NUM_ROWS(3)PG_NUM_ROWS(3)pg_num_rows - Returns the number of rows in a resultSYNOPSIS
int pg_num_rows (resource $result)
DESCRIPTION pg_num_rows(3) will return the number of rows in a PostgreSQL result resource.
Note
This function used to be called pg_numrows(3).
PARAMETERS
o $result
- PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others).
RETURN VALUES
The number of rows in the result. On error, -1 is returned.
EXAMPLES
Example #1
pg_num_rows(3) example
<?php
$result = pg_query($conn, "SELECT 1");
$rows = pg_num_rows($result);
echo $rows . " row(s) returned.
";
?>
The above example will output:
1 row(s) returned.
SEE ALSO pg_num_fields(3), pg_affected_rows(3).
PHP Documentation Group PG_NUM_ROWS(3)