can't figure out a way to delete multiple empty lines but keep single empty lines in a file, file is like this
#cat file
1
2
3
4
5
6
-
What I want is
1
2 (6 Replies)
I am attempting to delete blank lines in my file and I've used this command:
sed '/^$/d' $file > $file.fixed
all this seems to do is copy the file and not delete the blank lines located at the end of the file. Any assistance would be greatly appreciated. (3 Replies)
I have a file which contains blocks of text - each block is a multi-lines text delimited by blank lines eg.
<blank line>
several lines of text
...
pattern found on this line
several more lines of text
...
<blank line>
How do you delete the block of text (including the blank lines) when... (17 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)
Hi,
I want to use diff to compare two files in a Perl file. But one of the files has some blank lines at the end. So I want to delete the blank lines from the file firstly and then use diff to compare them. But I dont know how to delete the blank lines from the files. Meanwhile, the system is... (5 Replies)
Hi,
Consider a file named "testfile"
The contents of file are as below
first line added for test
second line added for test
third line added for test
fourth line added for test
fifth line added for test (5 Replies)
Hi All,
I have a file.txt which seems like having three lines.
wc -l file.txt
3 file.txt
In fact, once it is open in text editor, this file has four lines where the last line is empty. how can i delete this last empty line of the file.txt? I tried the codes below so far but they... (6 Replies)
Hi All,
I have a file and I need to delete the lines that are blank and is starting with some characters below. Something like below:
Regular Ascii File:
Line1: AGODA1 BUSAN||SK Lord Beach 4/6/2012 4/7/2012 68060
Line2: AGODA2 BUSAN||SK Beach Hotel 4/6/2012 4/7/2012 610200
Line3: ... (4 Replies)
Hi Gurus,
Somebody can say me how to delete blank spaces and blank lines in a file unix, please.
Thank you for advanced. (10 Replies)
Discussion started by: systemoper
10 Replies
LEARN ABOUT CENTOS
sgml2txt
SGML2TXT(1) General Commands Manual SGML2TXT(1)NAME
sgml2txt - create plain text output from a LinuxDoc DTD SGML source file
SYNOPSIS
sgml2txt [generic-option...] [--manpage] [--filter] [--blanks=n] file[.sgml]
DESCRIPTION
sgml2txt is an old and obsoleted form of the text converter command of LinuxDoc-Tools. It is recommended to switch the new form linuxdoc
-B text now. It converts a LinuxDoc DTD SGML source file to ASCII, ISO-8859-1, or EUC-JP output. Output will appear in file.txt where file
is the name of the SGML source file.
The attribute/value pair "output=txt" is set for conditionals.
OPTIONS
sgml2txt accepts all the generic options described in linuxdoc(1), and the following specific options:
--manpage, -m
Outputs a groff source file, suitable for formatting with groff -man for man pages
--filter, -f
Remove backspace-overstrikes from the intermediate form generated by groff(1).
--pass, -P
The argument of the pass option is added to the command-line options handed to groff(1).
--blanks=n, -b
Set the limit of continuous blank lines for generating the output document. The default limit is 3. if 0 (zero) is specified, the
result have many continuous blank lines.
file The SGML source file, named either file or file.sgml
FILES
Many files and executables in /usr/share/linuxdoc-tools are used.
BUGS
None known.
AUTHOR
Originally written by Greg Hankins <greg.hankins@cc.gatech.edu>, based on scripts by Tom Gordon and Alexander Horz, and later rewritten by
Cees de Groot <cg@cdegroot.com> for SGML-Tools (v1). Currently maintained by Taketoshi Sano <sano@debian.org> for Linuxdoc-Tools.
SEE ALSO linuxdoc(1), sgml2html(1), sgml2info(1), sgml2latex(1), sgml2lyx(1), sgml2rtf(1), sgmlcheck(1).
16 May 2000 SGML2TXT(1)