How to identify delimiter to find and replace a string with sed?
I need to find and replace a date format in a SQL script with sed. The original lines are like this:
Then I want to replace '01-JUL-2019' with variable which real value is '01-OCT-2019'. After replacement, the line in file should be like this:
AND ep.begin_date <= '01-OCT-2019'. I am not good at how to use sed to identify delimiter or separator and help sed to find right part of this string and replace it with right value. Please help with your code. My testing code is ugly so that I do not post them. I would like to learn from all of you. Thanks for help.
Hi Everyone,
I am new to this forum and new to sed/awk programming too !!
I need to find particular string in file1(text file) and replace it with a value from another text file(file2) the file2 has only one line and the value to be replaced with is in the second column.
file 1:
(assert (=... (21 Replies)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
I have the following output and would like to only identify strings with "vw" at the end.
Here is the file contents:
SELECT n.contract_num, n.descr, s.prj_level2_cf_val, r.descr, r.project_id,
p.offering_id, o.n_cust_contract, u.name1, ' ', ' ', SUM (0),
TO_CHAR (t.start_dt, 'YYYY-MM-DD'),... (6 Replies)
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
Hi All,
I have a file in which contains location of various data files. I want to change locations using sed. Find and replace strings are in a separate file. Content of this file (/tmp/tt) -
/dd/pp/test/test/1/ /pp/aa/test/dg1/
/dd/pp/test/test/2/ /pp/aa/test/dg2/
/dd/pp/test/test/3/... (2 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Hi,
Here's my dilemma.
I need to replace the string Sept_2012 to Oct_2012 in all *config.py files within the current directory and below directories
Is this possible?
Also I am trying to find all instances of the string Sept_2012 within files in the current directory and below
I have... (13 Replies)
I have a file example.txt as follows :SomeTextGoesHere
$$TODAY_DT=20140818
$$TODAY_DT=20140818
$$TODAY_DT=20140818I need to automatically update the date (20140818) in the above file, by getting the new date as argument, using a shell script.
(It would even be better if I could pass... (5 Replies)
Some help please:
Need to find string ||(everything in front of it)B0300|| and replace it with ||0|| globally
In:
16112121||||0||0||0||0||0||52||52||0||0||0||0||1507200053342B0300||1507200053342B0300||0||0||0||0700
Out:
16112121||||0||0||0||0||0||52||52||0||0||0||0||0||0||0||0||0||0700
... (4 Replies)
Hi Everyone,
I have a xml file, where i need to find this
HOST=dbhost.domain.com
and then replace only
dbhost.domain.com with db.one.in
so finally it should like this
HOST=db.one.in
i tried this but its not working.
sed -i "s/^HOST=*com$/HOST=db.one.in/g" repository.xml
^... (4 Replies)
Discussion started by: shajay12
4 Replies
LEARN ABOUT DEBIAN
rdf::query::compiler::sql
RDF::Query::Compiler::SQL(3pm) User Contributed Perl Documentation RDF::Query::Compiler::SQL(3pm)NAME
RDF::Query::Compiler::SQL - Compile a SPARQL query directly to SQL.
VERSION
This document describes RDF::Query::Compiler::SQL version 2.908.
METHODS
"new ( $parse_tree )"
Returns a new compiler object.
"compile ()"
Returns a SQL query string for the specified parse tree.
"emit_select"
Returns a SQL query string representing the query.
"limit_clause"
Returns a SQL LIMIT clause, or an empty string if the query does not need limiting.
"order_by_clause"
Returns a SQL ORDER BY clause, or an empty string if the query does not use ordering.
"variable_columns ( $var )"
Given a variable name, returns the set of column aliases that store the values for the column (values for Literals, URIs, and Blank
Nodes).
"add_variable_values_joins"
Modifies the query by adding LEFT JOINs to the tables in the database that contain the node values (for literals, resources, and blank
nodes).
"patterns2sql ( @triples, $level, %args )"
Builds the SQL query in instance data from the supplied @triples. $level is used as a unique identifier for recursive calls.
%args may contain callback closures for the following keys:
'where_hook'
'from_hook'
When present, these closures are used to add SQL FROM and WHERE clauses to the query instead of adding them directly to the object's
instance data.
"expr2sql ( $expression, $level, %args )"
Returns a SQL expression for the supplied query $expression. $level is used as a unique identifier for recursive calls.
%args may contain callback closures for the following keys:
'where_hook'
'from_hook'
When present, these closures are used to add necessary SQL FROM and WHERE clauses to the query.
"_mysql_hash ( $data )"
Returns a hash value for the supplied $data string. This value is computed using the same algorithm that Redland's mysql storage
backend uses.
"_mysql_node_hash ( $node )"
Returns a hash value (computed by "_mysql_hash" for the supplied $node. The hash value is based on the string value of the node and
the node type.
"qualify_uri ( $uri )"
Returns a fully qualified URI from the supplied $uri. $uri may already be a qualified URI, or a parse tree for a qualified URI or
QName. If $uri is a QName, the namespaces defined in the query parse tree are used to fully qualify.
"add_function ( $uri, $function )"
Associates the custom function $function (a CODE reference) with the specified URI, allowing the function to be called by query
FILTERs.
"get_function ( $uri )"
If $uri is associated with a query function, returns a CODE reference to the function. Otherwise returns "undef".
AUTHOR
Gregory Williams <gwilliams@cpan.org>
perl v5.14.2 2012-01-31 RDF::Query::Compiler::SQL(3pm)