Solved

I need to add a line with a slash after each paragraph in this script

Posted on 2013-06-28
2
492 Views
Last Modified: 2013-06-28
Hi experts.
I have the following script (Is much longer than this, so I can't do it manually, ), and I have to add a line that will have only a slash after each paragraph:

The name of the script is test.sql.  
Aix 6.1

BEGIN DBMS_STATS.GATHER_TABLE_STATS(
                ownname => 'SYSADM'
                ,tabname => 'PSACCESSLOG'
                ,estimate_percent => NULL
                ,block_sample => FALSE
                ,method_opt => 'FOR ALL INDEXED COLUMNS'
                ,degree => DBMS_STATS.AUTO_DEGREE
                ,cascade => FALSE
         );END;

BEGIN DBMS_STATS.GATHER_TABLE_STATS(
                ownname => 'SYSADM'
                ,tabname => 'PSAPMSGPUBCON'
                ,estimate_percent => NULL
                ,block_sample => FALSE
                ,method_opt => 'FOR ALL INDEXED COLUMNS'
                ,degree => DBMS_STATS.AUTO_DEGREE
                ,cascade => FALSE
         );END;

BEGIN DBMS_STATS.GATHER_TABLE_STATS(
                ownname => 'SYSADM'
                ,tabname => 'PSAPMSGPUBERR'
                ,estimate_percent => NULL
                ,block_sample => FALSE
                ,method_opt => 'FOR ALL INDEXED COLUMNS'
                ,degree => DBMS_STATS.AUTO_DEGREE
                ,cascade => FALSE
         );END;
0
Comment
Question by:LindaC
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 39284292
Assuming that the end of each paragraph is indicated by a line containing ");END;"

awk '{if ( $0~");END;") print $0 "\n/"; else print $0}' test.sql > new.test.sql
0
 
LVL 8

Author Closing Comment

by:LindaC
ID: 39284307
Thank you!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Search for selected keywords and its values in multiple log files 11 63
Where to get php 5.6 for AIX 7.1? 5 118
UNIX SCP 5 83
unix in java example 9 72
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question