Is there an option, for cat, head, tail, or is there any way, to display a file from last line to first? For example, my file
looks like this:
aaaa
bbbb
cccc
eeee
and I would like to print or display it like this:
eeee
cccc
bbbb
aaaa
thanks (5 Replies)
I need a command which filters rows ONLY NOT beginning with '*'
So far I have following NOT sufficient command, because it does not include ALL possible literals except of '*'
grep ^ INPUT_FILE >>OUTPUT_FILE
Is it possible to write something like
grep NOT ^
INPUT_FILE... (3 Replies)
Hi
i had String like
UID: ABC345QWE678GFK345SA90, LENGTH 32
when I used awk ' FS, {print $1}' prints
ABC345QWE678GFK345SA90,
how can i getrid of that coma at the end of the string.
Thanks in advance.. (14 Replies)
Suppose, I have a variable var=" name is ".
I want to remove the blank spaces from the begining and endonly, not from the entire string.
So, that the variable/string looks like following
var="name is".
Please look after the issue. (3 Replies)
What is a regex for "the dalai lama, his holiness the"
that would just grab "the dalai lama"
and one that would just grab "his holiness the"? Both should exclude the comma..
I was trying '^.*' and many variants with no luck. (6 Replies)
how to Remove comma as last charector in end of last line of file:
example:
input file
---------------
aaaaaa,
bbbbbb,
cccc,
12345,
____________
output file :
-----------
aaaaaa,
bbbbbb, (6 Replies)
It is very simple to remove a hyphen from a word anywhere in that word using a simple sed command (sed -i 's/-//g' filename), but I am not able to figure out how to do this:
For example,
apple
-orange
tree
pipe-
banana-shake
dupe-
What my output should look like:
apple
orange
tree... (1 Reply)
Hi,
How can we remove the comma from the end of each line.
I have a csv file in below format.
file.csv
Name,age,gender,location,
Joel,18,M,Newyork,
Monoj,21,M,Japan,
Litu,23,M,turki,
Expected o/p
file1.csv
Name,age,gender,location (4 Replies)
Hi,
I now that >> will append text to the end of the text that is already inside the file.
How to append the new text infront of the text that is already in the file.
Thanks for any input.
Regards,
Chandu (3 Replies)
Discussion started by: chandrakanth
3 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)