---------- Post updated at 08:49 AM ---------- Previous update was at 08:49 AM ----------
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
How to use instr function in awk ?
to get the location
a) for example instr('productiondata_12','data',1) to get the location of data using awk.
b) for example instr('sampledata_rev_12','rev',1) to get the location of data
and reaplce with "org" using awk.
can anyone help
... (3 Replies)
eg .
i have file x.txt contains :
java coding , shell scriptting etc...
now i want to add "is langauge" after word java.
output should be
java is langauge coding , shell scriptting etc...
any idea how to use shell script to do it ? (10 Replies)
I'm a relative newbie and apologize if this is silly... Suppose I have a file with English words and their Spanish translations. I read them in like this:
while(getline < myfile > 0) {
eng = $1
SPAN = $2
}
Now, for every eng in SPAN, I want to scan through SPAN and search for a... (2 Replies)
Hi,
I am trying to develop a script which should find a word if a particular word exists.
Below is the content of the file.
insert_job: test_job ----> job name
days_of_week: all
start_times: "16:00"
date_conditions: 1
insert_job: test_job2 ----> job name
days_of_week: all... (16 Replies)
Hey guys,
I'm a new bee to this forum as well as to Unix, just having a requirement which i'm not sure how to write shell script for it..
Here is my requirement
This is related to tomcat catalina.out file. Just want to display the content of this file until it finds a word like 'server... (2 Replies)
I'm try to change a the prohibit to aix for the lines starting with ssh and emagent and rest should be the same. Can anyone please suggest me how to do that using a shell script or sed
passwd account required /usr/lib/security/pam_prohibit
passwd session required ... (13 Replies)
Hi friends,
I have one XML file having below structure :-
INput XML file :-
<?xml version="1.0" encoding="UTF-8"?>
<START>
<A=value1>
<attr name1="a1">
</A>
<B=value2>
<attr name2="b1">
<attr name3="c1">
</B>
</START>
output xml file should be
=== (3 Replies)
I have a big file having 100 K lines.
I have to read each line and see at 356 character position whethere there is a word "W" in it. If it is their then don't delete the line otherwise delete it.
There are two lines as one Header and one trailer which should remain same.
Can somebody... (5 Replies)
Hello All,
Since i'm relatively new in shell script need your guidance.
I'm copying files manually based on a specific word in a file name and its extension and then moving it into some destination folder.
so if filename contains hyr word and it has .md and .db extension; it will move to TUM/HYR... (13 Replies)
Discussion started by: prajaktaraut
13 Replies
LEARN ABOUT OSX
sql::abstract::tree
SQL::Abstract::Tree(3) User Contributed Perl Documentation SQL::Abstract::Tree(3)NAME
SQL::Abstract::Tree - Represent SQL as an AST
SYNOPSIS
my $sqla_tree = SQL::Abstract::Tree->new({ profile => 'console' });
print $sqla_tree->format('SELECT * FROM foo WHERE foo.a > 2');
# SELECT *
# FROM foo
# WHERE foo.a > 2
METHODS
new
my $sqla_tree = SQL::Abstract::Tree->new({ profile => 'console' });
$args = {
profile => 'console', # predefined profile to use (default: 'none')
fill_in_placeholders => 1, # true for placeholder population
placeholder_surround => # The strings that will be wrapped around
[GREEN, RESET], # populated placeholders if the above is set
indent_string => ' ', # the string used when indenting
indent_amount => 2, # how many of above string to use for a single
# indent level
newline => "
", # string for newline
colormap => {
select => [RED, RESET], # a pair of strings defining what to surround
# the keyword with for colorization
# ...
},
indentmap => {
select => 0, # A zero means that the keyword will start on
# a new line
from => 1, # Any other positive integer means that after
on => 2, # said newline it will get that many indents
# ...
},
}
Returns a new SQL::Abstract::Tree object. All arguments are optional.
profiles
There are four predefined profiles, "none", "console", "console_monochrome", and "html". Typically a user will probably just use "console"
or "console_monochrome", but if something about a profile bothers you, merely use the profile and override the parts that you don't like.
format
$sqlat->format('SELECT * FROM bar WHERE x = ?', [1])
Takes $sql and "@bindargs".
Returns a formatting string based on the string passed in
parse
$sqlat->parse('SELECT * FROM bar WHERE x = ?')
Returns a "tree" representing passed in SQL. Please do not depend on the structure of the returned tree. It may be stable at some point,
but not yet.
unparse
$sqlat->unparse($tree_structure, @bindargs)
Transform "tree" into SQL, applying various transforms on the way.
format_keyword
$sqlat->format_keyword('SELECT')
Currently this just takes a keyword and puts the "colormap" stuff around it. Later on it may do more and allow for coderef based
transforms.
pad_keyword
my ($before, $after) = @{$sqlat->pad_keyword('SELECT')};
Returns whitespace to be inserted around a keyword.
fill_in_placeholder
my $value = $sqlat->fill_in_placeholder(@bindargs)
Removes last arg from passed arrayref and returns it, surrounded with the values in placeholder_surround, and then surrounded with single
quotes.
indent
Returns as many indent strings as indent amounts times the first argument.
ACCESSORS
colormap
See "new"
fill_in_placeholders
See "new"
indent_amount
See "new"
indent_string
See "new"
indentmap
See "new"
newline
See "new"
placeholder_surround
See "new"
perl v5.16.2 2012-06-14 SQL::Abstract::Tree(3)