Sponsored Content
Top Forums Web Development split line based on delimeter SQL Post 302552999 by ffdstanley on Tuesday 6th of September 2011 10:02:43 AM
Old 09-06-2011
Is there a way to do it inside SQL

I know that AWK can modify the data. However, do you know if there is a way to get it from the original SQL query?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split File Based on Line Number Pattern

Hello all. Sorry, I know this question is similar to many others, but I just can seem to put together exactly what I need. My file is tab delimitted and contains approximately 1 million rows. I would like to send lines 1,4,& 7 to a file. Lines 2, 5, & 8 to a second file. Lines 3, 6, & 9 to... (11 Replies)
Discussion started by: shankster
11 Replies

2. Shell Programming and Scripting

Split a line based on : using sed

Hi, i have a file say file1 having following data /abc/def:ghi/jkl/ some other text Now i want to extract only ghi/jkl/using sed, can some one please help me. Thanks Sarbjit (2 Replies)
Discussion started by: sarbjit
2 Replies

3. Shell Programming and Scripting

Need Awk command to get part of string based on delimeter

HI, Need awk command to get date and time alone from Input : "15:29:15 28.08.2010|SCHEDULE: Started program POSG1" Output expected : "15:29:15 28.08.2010" Please help. (9 Replies)
Discussion started by: shanneykar
9 Replies

4. Shell Programming and Scripting

How to merge 2 files based on delimeter in perl?

Hi, I have 2 files. a.txt & b.txt # a.txt contains the following text. apple grapes # b.txt contains the following text. banana pine My question is. (1 Reply)
Discussion started by: vanitham
1 Replies

5. Shell Programming and Scripting

Split a file into multiple files based on line numbers and first column value

Hi All I have one query,say i have a requirement like the below code should be move to diffent files whose maximum lines can be of 10 lines.Say in the below example,it consist of 14 lines. This should be moved logically using the data in the fisrt coloumn to file1 and file 2.The data of first... (2 Replies)
Discussion started by: sarav.shan
2 Replies

6. Shell Programming and Scripting

Return all characters to the left of the last delimeter of each line

Hello, Working on a ksh script and a little stumped... how can I return all characters to the left of the last delimeter per line in a file, skipping any lines without that delimeter? ie, sample.txt: Once_upon-a-Midnight_dreary_while I pondered, weak_and weary over many a quaint and... (4 Replies)
Discussion started by: MoreCowbell
4 Replies

7. Shell Programming and Scripting

Put delimeter in data based on value

Hi Friends, I have a file as below source.txt 12345JackYKing32N 1235 JulyYoig 31N i am using cut command for cutting the fields cut -c 1-5 source.txt 12345 1235 like above i have to use each time to cut all the fieds manually. I have a file(pre.txt) which tells... (3 Replies)
Discussion started by: i150371485
3 Replies

8. Shell Programming and Scripting

Split line of file from delimeter.

I have a below file. INPUT FILE select * from customer MERGE INTO Archive; delete from Employee; using select * from customer; delete from employee; select * from Employee; insert into employee(1,1); OUTPUT FILE select * from customer MERGE INTO Archive delete from Employee using... (5 Replies)
Discussion started by: Mohin Jain
5 Replies

9. Shell Programming and Scripting

How to split a file based on pattern line number?

Hi i have requirement like below M <form_name> sdasadasdMklkM D ...... D ..... M form_name> sdasadasdMklkM D ...... D ..... D ...... D ..... M form_name> sdasadasdMklkM D ...... M form_name> sdasadasdMklkM i want split file based on line number by finding... (10 Replies)
Discussion started by: bhaskar v
10 Replies

10. Shell Programming and Scripting

Split a line into multiple lines based on delimeters

Hi, I need help to split any lines that contain ; or , input.txtAc020 Not a good chemical process AC030 many has failed, 3 still maintained AC040 Putative; epithelial cells AC050 Predicted binding activity AC060 rodC Putative; upregulated in 48;h biofilm vs planktonic The output... (8 Replies)
Discussion started by: redse171
8 Replies
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.18.2 2014-01-16 SQL::Abstract::Tree(3)
All times are GMT -4. The time now is 03:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy