Sponsored Content
Top Forums Shell Programming and Scripting how can i remove comments in random positions in a file?(bash) Post 302312600 by bashuser2 on Saturday 2nd of May 2009 05:47:58 AM
Old 05-02-2009
Quote:
Originally Posted by devtakh
Code:
sed 's/#//g' filename

will give
bla bla
bla bla bla bla bla

Bla
BLA
BLA BLA bla bla
....
....

cheers,
Devaraj Takhellambam

thnks a lot!i found another solution too but i will try this one as wellSmilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remove comments...

It may be a no-brainer, but the answer is escaping me right now: I'm trying to write a little script to remove all comments from .c source... I was thinking sed, but I'm not a very strong regexp user (e.g. I suck with sed). I tried dumping the file into: sed -e 's/\/\* * \*\///g' and several... (1 Reply)
Discussion started by: LivinFree
1 Replies

2. UNIX for Dummies Questions & Answers

Remove blank lines and comments from text file

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)
Discussion started by: msb65
3 Replies

3. 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

4. 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

5. Shell Programming and Scripting

How to remove comments from a bash script?

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)
Discussion started by: LessNux
10 Replies

6. Shell Programming and Scripting

Remove dashes if exist between positions 351-357 and then add - at the 357th position

I need to remove dash (i.e. -) if present from positions 351-357, and then add - (dash) at 357th position. For example in following first and 3rd record we got Before processing 1) 1st Record positions 351-357 = 0-12345 2) 3rd Record positions 351-357 = 00-4567 After processing:- 1) 1st... (7 Replies)
Discussion started by: lancesunny
7 Replies

7. Shell Programming and Scripting

Remove comments from file with specific file name extensions

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)
Discussion started by: TheZeusMan
3 Replies

8. UNIX for Dummies Questions & Answers

Remove SAS comments using UNIX

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)
Discussion started by: saaisiva
1 Replies

9. Shell Programming and Scripting

Bash script to find comments in file

As I stated in a previous thread - I'm a newbie to Unix/Linux and programming. I'm trying to learn the basics on my own using a couple books and the exercises provided inside. I've reached an exercise that has me stumped. I need to write a bash script that will will read in a file and print the... (11 Replies)
Discussion started by: ksmarine1980
11 Replies

10. Shell Programming and Scripting

Remove comments like pattern from text

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
FTE(1)							      General Commands Manual							    FTE(1)

NAME
fte - Text editor SYNOPSIS
fte [[options] files ...] xfte [[options] files ...] vfte [[options] files ...] nfte [[options] files ...] sfte [[options] files ...] DESCRIPTION
This manual page documents briefly the fte. Some detailed documentation is available html format, see below. fte is a powerful text editor which closely resembles Borlands programming editors for M$-DOS, but is far more flexible and configurable. OPTIONS
fte uses a command line syntax, which is a little bit different from most of Debian GNU/Linux apps. -h -? --help Help on command line options. -! Ignore any external configuration file and use internal configuration. -l<line>[,<column>] Go to line (and column) in next file on command line. -#<line>[<,column>] Same as -l. Do not use this option. -m[<mode>] Set mode for next files to <mode>. If just plain -m, then use default mode. -C[<.cnf>] Use specified configuration file (compiled). Plain -C does the same as -!. -D[<.dsk>] Load/save desktop from file <.dsk>. If no argument, disable desktop load/save. -H[<.his>] Load/save history from file <.his>. If no argument, disable history load/save. -T<tagfile> Load 'tagfile' at startup. -t<tag> Lookup tag 'tag' and display file containing it. -- The rest of the arguments are not options, but filenames. -+ The next argument is not an option even if starting with a '-'. Useful when loading files that begin with a -. -noi18n Do not use locales in xfte - useful if you have incorrect locales. -noxmb Do not use XMB functions in xfte - useful if you have incorrect locales and you want to use just english fonts. -font Select XWindow font to use with xfte. See VIOFONT also. ENVIRONMENTAL VARIABLES
This is list of variable which might change behavior of some internals of fte. VIOFONT - select font used by xfte ISOCONSOLE - when set, vfte is usign ascii symbols to draw tables. This is useful when iso latin charset is used on console. EXAMPLES
fte -mBIN /usr/bin/vfte load /usr/bin/vfte in BIN mode fte -mBIN -+ -bla- load file -bla- in BIN mode fte -l100,30 win.c go to (100,30) in win.c fte window.cpp load file window.cpp fte -- -1 -2 -3 -4 -5 -6 load files -1, -2, -3, -4, -5, -6 fte -D -H fte.dsk fte.his disable desktop and history loading and saving and load files fte.dsk and fte.his FILES
~/.fterc /usr/local/etc/fte/system.fterc /etc/fte/system.fterc Default configuration files. Includes all keybindings and menus compiled with cfte(1) from config files in /usr/share/doc/fte/config-exam- ple.tar.gz. SEE ALSO
cfte(1), /usr/share/doc/fte/contents.html AUTHORS
This manual page was written by Riku Voipio and Zdenek Kabelac <riku.voipio@iki.fi> <kabi@debian.org> for the Debian GNU/Linux system. DATE
18 Nov 1999 FTE(1)
All times are GMT -4. The time now is 09:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy