![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiline Grep | tolmark | UNIX for Dummies Questions & Answers | 4 | 03-14-2008 12:31 AM |
| handling Multiline SQL outputs | decci_7 | Shell Programming and Scripting | 5 | 01-08-2008 07:29 PM |
| Awk Compare Files w/Multiline Records | RacerX | Shell Programming and Scripting | 4 | 12-21-2007 06:05 AM |
| Help needed in deleting the files | Sheethal | UNIX for Dummies Questions & Answers | 2 | 11-13-2007 09:20 AM |
| Block Comment in Shell script | skyineyes | Shell Programming and Scripting | 3 | 07-02-2007 07:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi
I have a script to delete the multiline comments as below ******************************************** #!/usr/bin/sed -f #Replaces single line comment s://.*:: #Replaces multiline comment present in a single line s:/\*[^\*/]*\*/::g #Starting of the loop for checking the starting of the multi-line comment /\/\*/!bc #Searches for the ending part of the multiline comment :a /\*\//!{ N ba } s:/\*.*\*/:: :c ***************************************************** It is working fine in deleting the comments. However ther is a problem. I am using it for a dml as below **************************************************** record ebcdic string(7) f7ezstat_as_of_date; ebcdic string(2) f7ezstat_data_source; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_1; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_2; ebcdic string(8) f7ezstat_hierarchy_key_3; /* needed */ packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_4; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_5; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_6; packed decimal(15,0,unsigned) f7ezstat_channel_id; packed decimal(15,0,unsigned) f7ezstat_segment_id; packed decimal(15,2) f7ezstat_volume; end **************************************************** here there is no new line character after the "end". This is causing the problem....... If the no. of fields between "record" and "end" is more than 9.... the o/p is *************************************************** record ebcdic string(7) f7ezstat_as_of_date; ebcdic string(2) f7ezstat_data_source; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_1; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_2; ebcdic string(8) f7ezstat_hierarchy_key_3; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_4; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_5; packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_6; packed decimal(15,0,unsigned) f7ezstat_channel_id; packed decimal(15,0,unsigned) f7ezstat_segment_id; packed decimal(15,2) f7ezstat_volume; **************************************************** The "end" goes missing...... but if the same is done with less than 9 fields.... all works fine.... we are using the following command to run it sed -f sed.ksh f7_ez_f7ezstat_ebcdic.dml here sed.ksh is the script to delete the comments and f7_ez_f7ezstat_ebcdic.dml is the dml. Please help |
|
||||
|
Please edit your post and use code tags [code] to for code and sample data.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| code, multiline comments, sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|