01-18-2012
This User Gave Thanks to zaxxon For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I want to be able to list all the names in a file which begin with a capital letter, but I don't want it to list words that begin a new sentence. Is there any way round this?
Thanks for your help. (1 Reply)
Discussion started by: kev269
1 Replies
2. UNIX for Dummies Questions & Answers
Hi to all,
I am looking a file in vi editor to get 100th occurance of a latter in that file.
Can any one help me in this?
Thanks
Sathish (1 Reply)
Discussion started by: bsathishmca
1 Replies
3. Shell Programming and Scripting
Hi
I am running a shell script with bdf command and want to match all files with length 3 inside a specific partitions. How do i do that
say
for example if i want to list all files with length 3 in /home/jimmy partition,
bdf /home/jimmy
the output i need is
xyx
abc
yyy
amp
... (4 Replies)
Discussion started by: PrasannaKS
4 Replies
4. Shell Programming and Scripting
How to check whether a particular string contains dot or not?
Here I can not use grep as the string is not in a file. I will get this string from user input
Thanks, (2 Replies)
Discussion started by: balamv
2 Replies
5. UNIX for Dummies Questions & Answers
Hi im a noob in Unix
Do you guys know what command display you the files that have the character n in there name im not looking that they have the n in the beginning or in the end im looking that in search the entire string to see if it have the character n i try this
ls n*
but only show... (2 Replies)
Discussion started by: Kaziduz
2 Replies
6. Shell Programming and Scripting
Hi,
I have lets say 10 files , I need to process them one by one.
So I need a command to get one file name at a time to process it into a variable
Example
Files
P1111.dat
P3344.dat
S344.dat
...
v_file_name = 'p111.dat' .. I will rename it to something after processing
... (1 Reply)
Discussion started by: prassu
1 Replies
7. Shell Programming and Scripting
i would like to search for a letter in a string and get its index position.
example:
name='john'
pos=$(expr index $name o)
the result will be equal to 2 (2nd position)
how do you make this thing not case sensitive?
example:
name='john'
pos=$(expr index $name O)
the... (1 Reply)
Discussion started by: kokoro
1 Replies
8. Shell Programming and Scripting
I do have a large tab delimited file with the following format
CCCCCGCCCCCCCCCCcCCCCCCCCCCCCCCCC 23 65 3 4
AAAAAAAAAAAAAAAAaAAAAAAAAAAAAAAAA 24 6 89 90
TGTTTTTTTTTTTTGGtTTTTTTTTTTTTTTTT 2 4 8 90
TTTT-TTTTTTTTTTTtTTTTTTTTTTTTTTTT 1 34 89 50
GGGGGGGGGGGGGGGGTGGGGGGGGGGGGGGGG 87 6 78 66... (8 Replies)
Discussion started by: Lucky Ali
8 Replies
9. Shell Programming and Scripting
I am trying to remove the last letter in a file and then multiply each line (which contained this letter) by 500. This is what I have:
1499998A
1222222A
1325804A
1254556
1235
9998
777
cat /tmp/listzz |gawk '{print $4}'|gawk '{gsub(//, ""); print } This removes the A... (1 Reply)
Discussion started by: newbie2010
1 Replies
10. Shell Programming and Scripting
Good afternoon all,
I want to ask how to change some letter in my file with other letter in spesific line
eg.
data.txt
1
1
1
0
0
0
0
for example i want to change the 4th line with character 1.
How could I do it by SED or AWK.
I have tried to run this code but actually did not... (3 Replies)
Discussion started by: weslyarfan
3 Replies
LEARN ABOUT PHP
pg_escape_string
PG_ESCAPE_STRING(3) PG_ESCAPE_STRING(3)
pg_escape_string - Escape a string for query
SYNOPSIS
string pg_escape_string ([resource $connection], string $data)
DESCRIPTION
pg_escape_string(3) escapes a string for querying the database. It returns an escaped string in the PostgreSQL format without quotes.
pg_escape_literal(3) is more preferred way to escape SQL parameters for PostgreSQL. addslashes(3) must not be used with PostgreSQL. If the
type of the column is bytea, pg_escape_bytea(3) must be used instead. pg_escape_identifier(3) must be used to escape identifiers (e.g. ta-
ble names, field names)
Note
This function requires PostgreSQL 7.2 or later.
PARAMETERS
o $connection
- PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection
is the last connection made by pg_connect(3) or pg_pconnect(3).
o $data
- A string containing text to be escaped.
RETURN VALUES
A string containing the escaped data.
CHANGELOG
+--------+-------------------+
|Version | |
| | |
| | Description |
| | |
+--------+-------------------+
| 5.2.0 | |
| | |
| | $connection added |
| | |
+--------+-------------------+
EXAMPLES
Example #1
pg_escape_string(3) example
<?php
// Connect to the database
$dbconn = pg_connect('dbname=foo');
// Read in a text file (containing apostrophes and backslashes)
$data = file_get_contents('letter.txt');
// Escape the text data
$escaped = pg_escape_string($data);
// Insert it into the database
pg_query("INSERT INTO correspondence (name, data) VALUES ('My letter', '{$escaped}')");
?>
SEE ALSO
pg_escape_bytea(3).
PHP Documentation Group PG_ESCAPE_STRING(3)