10-11-2015
Thank you so much Rudic and Scrutinizer. Both your solutions worked for me. What Rudic said is right if the previous line terminated with 1 then it would replace that with semi colon. I hope that I don't have such a condition in the rest of my files where I want to do this search and replace.
My goal is that I want to separate each SQL statement in a file by a semi colon. In my SQL I don't have appropriate semicolons separation for all the SQL statements. My end goal is to run this SQL file via Teradata Bteq utility successfully.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies
2. Shell Programming and Scripting
Sed replace using same pattern repeating multiple times in a line
I have text like below in a file:
I am trying to replace the above line to following
How can I acheive this?
I am able to do it if the occurrence is for 1 time:
But If I try like below
I am getting like this:
I have to... (4 Replies)
Discussion started by: sol_nov
4 Replies
3. Shell Programming and Scripting
hi guys,
im trying to add the following line in my xml file
<dbrollbacksegs <oa_var="s_db_rollback_segs">NOROLLBACK</dbrollbacksegs>
when ever i find the following line
<dbsharedpool oa_var="s_dbsharedpool_size">300000000</dbsharedpool>
I have succedded till adding a new line... (1 Reply)
Discussion started by: smarlaku
1 Replies
4. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have file which has got the following content
sam 123 LD 41
sam 234 kp
sam LD 41
kam pu
sam LD 61
Now... (1 Reply)
Discussion started by: muchyog
1 Replies
5. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
6. Shell Programming and Scripting
Hi,
I have a log file which has sessionids in it, each block in the log starts with a date entry, a block may be a single line or multiple lines. I need to sed (or awk) out the lines/blocks with that start with a date and include the session id.
The files are large at several Gb.
My... (3 Replies)
Discussion started by: andyatit
3 Replies
7. Shell Programming and Scripting
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
8. Shell Programming and Scripting
Hello Experts , require help . See below output:
File inputs
------------------------------------------
Server Host = mike
id rl images allocated last updated density
vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies
9. UNIX for Advanced & Expert Users
I have a line that I need to parse through and extract a pattern that occurs multiple times in it.
Example line:
getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed, getInfoCall: info received please proceed,... (4 Replies)
Discussion started by: Vidhyaprakash
4 Replies
10. UNIX for Beginners Questions & Answers
Looking for help,
i have input file like below and want to modify to expected output, if can without create additional file, hope can direct modify it.
have 2 thing need do.
1st
is adding a word (testplan generation off) after ! ! IPG: Tue Aug 07 14:31:17 2018
2nd
is adding... (16 Replies)
Discussion started by: kttan
16 Replies
LEARN ABOUT DEBIAN
sql::reservedwords::sqlserver
SQL::ReservedWords::SQLServer(3pm) User Contributed Perl Documentation SQL::ReservedWords::SQLServer(3pm)
NAME
SQL::ReservedWords::SQLServer - Reserved SQL words by SQL Server
SYNOPSIS
if ( SQL::ReservedWords::SQLServer->is_reserved( $word ) ) {
print "$word is a reserved SQL Server word!";
}
DESCRIPTION
Determine if words are reserved by SQL Server.
METHODS
is_reserved( $word )
Returns a boolean indicating if $word is reserved by SQL Server 7, 2000 or 2005.
is_reserved_by_sqlserver7( $word )
Returns a boolean indicating if $word is reserved by SQL Server 7.
is_reserved_by_sqlserver2000( $word )
Returns a boolean indicating if $word is reserved by SQL Server 2000.
is_reserved_by_sqlserver2005( $word )
Returns a boolean indicating if $word is reserved by SQL Server 2005.
reserved_by( $word )
Returns a list with SQL Server versions that reserves $word.
words
Returns a list with all reserved words.
EXPORTS
Nothing by default. Following subroutines can be exported:
is_reserved
is_reserved_by_sqlserver7
is_reserved_by_sqlserver2000
is_reserved_by_sqlserver2005
reserved_by
words
SEE ALSO
http://msdn2.microsoft.com/en-us/library/ms130214.aspx
AUTHOR
Christian Hansen "chansen@cpan.org"
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2008-03-28 SQL::ReservedWords::SQLServer(3pm)