Solved

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

Posted on 2013-06-28
2
483 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now