if you happen to be able to view the book "Mastering Regualr Expresstions" by Oreilly page 171-174 are pretty much dedicated to writeing a regx for this very purpose.
taken from the book:
but still needing some refined work due to comments offten span multi lines.
#! /bin/sed -nf
# Remove C and C++ comments, by Brian Hiles (brian_hiles@rocketmail.com)
# Sped up (and bugfixed to some extent) by Paolo Bonzini (bonzini@gnu.org)
# Works its way through the line, copying to hold space the text up to the
# first special character (/, ", '). The original... (1 Reply)
Suppose i have a file like this:
#bla bla
#bla bla bla bla bla
Bla
BLA
BLA BLA #bla bla
....
....
how can i remove all comments from every line,even if they are behind commands or strngs that are not comments?
any idea how i could do that using awk? (2 Replies)
I must write a script to change all C++ like comments:
// this is a comment
to this one
/* this is a comment */
How to do it by sed? With file:
#include <cstdio>
using namespace std; //one
// two
int main() {
printf("Example"); // three
}//four
the result should be: (2 Replies)
Hi,
I am using BASH. How can I remove any lines in a text file that are either blank or begin with a # (ie. comments)? Thanks in advance.
Mike (3 Replies)
I need to use sed to remove comments from files. I am using this, but it only works on comments that start at the beginning of the line.
sed /^"\/\/"/d
In most of the files I have comments like this:
code // Comments
or
tab // Comments (5 Replies)
I would like to remove comments from a bash script. In addition, I would like to remove lines that consist of only white spaces, and to remove blank lines.
#!/bin/bash
perl -pe 's/ *#.*$//g' $1 | grep -v ^]*$ | perl -pe 's/ +/ /g' > $2
#
# $1 INFILE
# $2 OUTFILE
The above code... (10 Replies)
Hello Unix board community,
I have to program a shell script, but I am a complete noob so I hope I get some help here. The assignment is as follows:
The program removes all comments regardless of formatting or language from files with specific file name extensions (php, css, js, ...).... (3 Replies)
I have tried a lot, Need your help guys.
SAS Program:
data one ; /* Data step */
Input name $; /*Dec variables*/
I want to remove the commented part(/* Data step */) alone. I have tried using sed command but it is deleting the entire line itself. i need unix command to separate this and... (1 Reply)
Hi , We need to remove comment like pattern from a code text. The possible comment expressions are as follows.
Input
BizComment : Special/*@
Name:bzt_53_3aea640a_51783afa_5d64_0
BizHidden:true
@*/
/* lookup Disease
Category Therapuetic Class */
a=b;... (6 Replies)
Discussion started by: VikashKumar
6 Replies
LEARN ABOUT OPENSOLARIS
libebook-1.2
libebook-1.2(3) User Commands libebook-1.2(3)NAME
libebook-1.2, libedata-book-1.2 - addressbook library, backend library for Evolution addressbook
DESCRIPTION
libebook-1.2 provides classes for client interactions. It relies on the classes in libedata-book which runs in an instance of Evolution
Data Server to provide the data.
libedata-book-1.2 provides classes for backend implementation. Writing an address book backend for the Evolution Data Server involves
extending the EBookBackend class and implementing its virtual methods. Backends that require network communication generally extend the
EBookBackend class. This class makes sure the backend return the results of its operations asynchronously. Other backends, including the
file and vcf ones, extend EBookBackendSync, which is derived from EBookBackend and provides wrappers around its virtual functions to facil-
itate backend implementation when network performance is not of concern.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWevolution |
+-----------------------------+-----------------------------+
|Interface stability |Private |
+-----------------------------+-----------------------------+
SEE ALSO evolution(1), libecal(3), libedataserver(3), attributes(5), gnome-interfaces(5)NOTES
Sun does not guarantee the stability of these interfaces and does not recommend their use. API documentation for these interfaces is pro-
vided by the Evolution free software community for those who wish to develop using these interfaces. However, you can visit the following
URL for more information:
http://www.gnome.org/projects/evolution/developer-doc/libebook/EBook.html
Written by Nancy Cai, Sun Microsystems Inc., 2006.
SunOS 5.11 11 Oct 2006 libebook-1.2(3)