Sponsored Content
Top Forums Shell Programming and Scripting changing c comments to c++ style with sed Post 302431354 by kolage on Tuesday 22nd of June 2010 04:56:21 AM
Old 06-22-2010
I don't know how to do that... I just want to change comment like this:

Code:
/* Some comments1
   some comments2
   some comments3 */

to this:

Code:
// Some comments1
// some comments2
// some comments3



---------- Post updated 06-22-10 at 10:56 AM ---------- Previous update was 06-21-10 at 10:26 PM ----------

please anyone ??? Smilie
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Changing text with sed?

Hi everyone, Having trouble with sed. I searched the board and found some stuff, but still unclear. I have a file named "userfile" which stores the users info in this form: email:username:password: I want the user to be able to change their password. i tried with sed s/oldpass/newpass/g... (2 Replies)
Discussion started by: primal
2 Replies

2. UNIX for Dummies Questions & Answers

Changing the order using sed

I have a text "abc def ghi" and I want to get it as "def abc ghi" I am using this echo "abc def ghi" | sed 's/\(*\)\(*\)/\2\1/' But I am not able to get the output, could anyone help me. Thanks (9 Replies)
Discussion started by: venu_nbk
9 Replies

3. Shell Programming and Scripting

sed and changing the file itself

hello I have this: sed -e "s/install_location=....../g" -e "s/hostname=....../g" -e "s/server_name=....../y" input.txt it will display on the screen what have changed. however I want to change file input.txt. Any idea other than doing redirection (>) thx (2 Replies)
Discussion started by: melanie_pfefer
2 Replies

4. Shell Programming and Scripting

awk, sed, grep...weird style

my desired output is like this: so the thing is, I only need to show every of this part out but the frequency of that data is not fixed, so sometimes it may have 4 lines, or 6 lines or whatever in that file. However, the last line will always have empty space/line below it. (13 Replies)
Discussion started by: finalight
13 Replies

5. Shell Programming and Scripting

please explain this sed shell script to remove C++ comments.

#! /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)
Discussion started by: Priyaranjan
1 Replies

6. Shell Programming and Scripting

Sed script, changing all C-comments to C++-comments

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)
Discussion started by: black_hawk
2 Replies

7. Shell Programming and Scripting

sed remove css comments

Is there a way that I can use sed to remove lines with css comments like this? /* comment */ (9 Replies)
Discussion started by: gravesit
9 Replies

8. Shell Programming and Scripting

sed remove comments

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)
Discussion started by: gravesit
5 Replies

9. Shell Programming and Scripting

Changing time-stamp with sed

Hi ! I try to change a time-stamp hh:mm:ss allways to full ten-minutes. example: 12:51:03 to 12:50:03 sed 's/::/:{0-5}0:/g' file.txt but it will not work propperly, because the minute-decade will be replaced with the bracket-term {0-5}. Can someone please give me a hint? Thanks in... (6 Replies)
Discussion started by: IMPe
6 Replies
PYGETTEXT(1)						      General Commands Manual						      PYGETTEXT(1)

NAME
pygettext - Python equivalent of xgettext(1) SYNOPSIS
pygettext [OPTIONS] INPUTFILE ... DESCRIPTION
pygettext is deprecated. The current version of xgettext supports many languages, including Python. pygettext uses Python's standard tokenize module to scan Python source code, generating .pot files identical to what GNU xgettext generates for C and C++ code. From there, the standard GNU tools can be used. pygettext searches only for _() by default, even though GNU xgettext recognizes the following keywords: gettext, dgettext, dcgettext, and gettext_noop. See the -k/--keyword flag below for how to augment this. OPTIONS
-a, --extract-all Extract all strings. -d, --default-domain=NAME Rename the default output file from messages.pot to name.pot. -E, --escape Replace non-ASCII characters with octal escape sequences. -D, --docstrings Extract module, class, method, and function docstrings. These do not need to be wrapped in _() markers, and in fact cannot be for Python to consider them docstrings. (See also the -X option). -h, --help Print this help message and exit. -k, --keyword=WORD Keywords to look for in addition to the default set, which are: _ You can have multiple -k flags on the command line. -K, --no-default-keywords Disable the default set of keywords (see above). Any keywords explicitly added with the -k/--keyword option are still recognized. --no-location Do not write filename/lineno location comments. -n, --add-location Write filename/lineno location comments indicating where each extracted string is found in the source. These lines appear before each msgid. The style of comments is controlled by the -S/--style option. This is the default. -o, --output=FILENAME Rename the default output file from messages.pot to FILENAME. If FILENAME is `-' then the output is sent to standard out. -p, --output-dir=DIR Output files will be placed in directory DIR. -S, --style=STYLENAME Specify which style to use for location comments. Two styles are supported: o Solaris # File: filename, line: line-number o GNU #: filename:line The style name is case insensitive. GNU style is the default. -v, --verbose Print the names of the files being processed. -V, --version Print the version of pygettext and exit. -w, --width=COLUMNS Set width of output to columns. -x, --exclude-file=FILENAME Specify a file that contains a list of strings that are not be extracted from the input files. Each string to be excluded must appear on a line by itself in the file. -X, --no-docstrings=FILENAME Specify a file that contains a list of files (one per line) that should not have their docstrings extracted. This is only useful in conjunction with the -D option above. If `INPUTFILE' is -, standard input is read. BUGS
pygettext attempts to be option and feature compatible with GNU xgettext where ever possible. However some options are still missing or are not fully implemented. Also, xgettext's use of command line switches with option arguments is broken, and in these cases, pygettext just defines additional switches. AUTHOR
pygettext is written by Barry Warsaw <barry@zope.com>. Joonas Paalasmaa <joonas.paalasmaa@iki.fi> put this manual page together based on "pygettext --help". pygettext 1.4 PYGETTEXT(1)
All times are GMT -4. The time now is 11:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy