On Wed, Mar 15, 2000 at 08:50:44PM +0530, Manoj Kumar wrote:
>
> I have a 10 MB file (text file ) There i have space in lines like
> after 4 line 3 line spaec or after 4 line 2 line space.
>
> I want to remove this line space from complete file.  Can some one
> suggest how to remove this line space in complete file. (not using dd
> command).

If I got you correctly, you wish to remove all duplicate `empty' lines.
We'll do in in two steps.  First replace all whitespace lines with
really empty lines:

        % cat text_file | sed -e 's/^[ ^I]$//g'

The ^I is a raw TAB character, which in Bash for instance you need to
enter as Ctrl-V followed by Ctrl-I.

Then, you can use uniq to suppress the multiple lines in one, as in:

        % cat text_file | sed -e 's/^[ ^I]$//g' | uniq

or you can grep -v the empty lines, to remove them completely.

        % cat text_file | sed -e 's/^[ ^I]$//g' | grep -v '^$'

[ BTW: none of the two cross-posted lists is not the proper list to ask
  such questions. ]

Ciao :)

- Giorgos Keramidas
-====---====---====---====---====---====---====---====---====---====---====-
 to unsubscribe email "unsubscribe linux-admin" to [EMAIL PROTECTED]
 See the linux-admin FAQ: http://www.kalug.lug.net/linux-admin-FAQ/

Reply via email to