![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiline Grep | tolmark | UNIX for Dummies Questions & Answers | 4 | 03-13-2008 09:31 PM |
| handling Multiline SQL outputs | decci_7 | Shell Programming and Scripting | 5 | 01-08-2008 04:29 PM |
| Awk Compare Files w/Multiline Records | RacerX | Shell Programming and Scripting | 4 | 12-21-2007 03:05 AM |
| Help needed in deleting the files | Sheethal | UNIX for Dummies Questions & Answers | 2 | 11-13-2007 06:20 AM |
| Block Comment in Shell script | skyineyes | Shell Programming and Scripting | 3 | 07-02-2007 04:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Please edit your post and use code tags [code] to for code and sample data.
|
|||
| Google The UNIX and Linux Forums |
| Tags |
| code, multiline comments, sed |
| Thread Tools | |
| Display Modes | |
|
|