Commenting a specific line and inserting a new line after commented line.
Hello All,
I have following file contents
I would like to comment line
and insert a new line
immediate after this.
I wrote following command to comment my line:
And Google for inserting a new line and found following solution:
I tried to combine both commands in a single command using “|” but I am not able to get it correctly. Can anyone please help me to achieve this objective?
2nd command to insert a new line is divided in 2 lines (using “\”). I tried several option to make it in a single line but every time it gives me some error. Can you please help me to combine 2nd command in a single line?
Hi,
Suppose I have a file which contains many lines,
----------------------
wake up
study hard
play a little
getting hungry <---- insert a line after this line
watch TV
go shopping
come back home
getting hungry <--- insert a line after this line
listen music
surf internet
go to... (2 Replies)
Hi
Is there any command where we can insert a line "2|||" before every line starting with "3|"
my input is as follows
1|ETG|12345
3|79.58|||GBP||
1|ETG|12345
3|79.58|||GBP||
1|ETG|12345
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
1|ETG|12345
3|88.51|||GBP||
desired output... (10 Replies)
this is utterly embarassing :(
after posting here i revisited my files and found that when i used "vi" instead of a gui based editor, i suddenly found that the indentations were in fact wrong :(
sorry about this :( (0 Replies)
Friends ,
I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated.
My File
control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1
control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
I use zentyal for my server admin, which is great but zentyal auto-generates config file on boot and hence overwrites any changes made directly to config files. In order to allow multiple user access to a MS ACCESS database, I need to customise the smb.conf file and add the following line to the... (9 Replies)
Dear UNIX community,
I would like to to count characters from a specific row and have them displayed line-by-line.
I have a file called testAwk2.csv which contain the following data:
rabbit penguin goat
giraffe emu ostrich I would like to count in the middle row individually... (4 Replies)
Say the input was as follows:
Brat 20 x 1000 32rf
Pour 15 p 1621 05pr
Dart 10 z 1111 22xx
My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour"
I currently have this line but it is... (6 Replies)
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
erl_comment_scan(3erl) Erlang Module Definition erl_comment_scan(3erl)NAME
erl_comment_scan - Functions for reading comment lines from Erlang source code.
DESCRIPTION
Functions for reading comment lines from Erlang source code.
DATA TYPES
comment() = {integer(), integer(), integer(), [string()]} :
EXPORTS
file(FileName::filename() (see module file)) -> [Comment]
Types Comment = {Line, Column, Indentation, Text}
Line = integer()
Column = integer()
Indentation = integer()
Text = [string()]
Extracts comments from an Erlang source code file. Returns a list of entries representing multi-line comments, listed in order of
increasing line-numbers. For each entry, Text is a list of strings representing the consecutive comment lines in top-down order; the
strings contain all characters following (but not including) the first comment-introducing % character on the line, up to (but not
including) the line-terminating newline.
Furthermore, Line is the line number and Column the left column of the comment (i.e., the column of the comment-introducing % char-
acter). Indent is the indentation (or padding), measured in character positions between the last non-whitespace character before the
comment (or the left margin), and the left column of the comment. Line and Column are always positive integers, and Indentation is a
nonnegative integer.
Evaluation exits with reason {read, Reason} if a read error occurred, where Reason is an atom corresponding to a Posix error code;
see the module file(3erl) for details.
join_lines(Lines::[CommentLine]) -> [Comment]
Types CommentLine = {Line, Column, Indent, string()}
Line = integer()
Column = integer()
Indent = integer()
Comment = {Line, Column, Indent, Text}
Text = [string()]
Joins individual comment lines into multi-line comments. The input is a list of entries representing individual comment lines, in
order of decreasing line-numbers ; see scan_lines/1 for details. The result is a list of entries representing multi-line comments,
still listed in order of decreasing line-numbers , but where for each entry, Text is a list of consecutive comment lines in order of
increasing line-numbers (i.e., top-down).
See also: scan_lines/1 .
scan_lines(Text::string()) -> [CommentLine]
Types CommentLine = {Line, Column, Indent, Text}
Line = integer()
Column = integer()
Indent = integer()
Text = string()
Extracts individual comment lines from a source code string. Returns a list of comment lines found in the text, listed in order of
decreasing line-numbers, i.e., the last comment line in the input is first in the resulting list. Text is a single string, contain-
ing all characters following (but not including) the first comment-introducing % character on the line, up to (but not including)
the line-terminating newline. For details on Line , Column and Indent , see file/1 .
string(Text::string()) -> [Comment]
Types Comment = {Line, Column, Indentation, Text}
Line = integer()
Column = integer()
Indentation = integer()
Text = [string()]
Extracts comments from a string containing Erlang source code. Except for reading directly from a string, the behaviour is the same
as for file/1 .
See also: file/1 .
AUTHORS
Richard Carlsson <richardc@it.uu.se >
syntax_tools 1.6.7 erl_comment_scan(3erl)