To send mail with same format as in file

I want to send the content in same format as it is in file.

#!/bin/sh
cat /usr/test/abc  > /usr/test/abc/file
if [ -s /usr/test/abc/file ]
then
MAILTO=test@yahoo.com
CONTENT="/usr/test/abc/file"
(
echo "Subject: TEST "
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
cat $CONTENT
) | /usr/sbin/sendmail -t $MAILTO
else
echo "bbb"
fi

There are many posts on this site referring to sending mail with attachments. Such as:

Also, use the Search function on the main toolbar to look for more.

I dont want to attch the file but it want to cat the content and send them in same format example

if file has data..

 
Asia 5.2
Europe 7.2
North America 5.5

than the mail should have the same format as

 
Asia 5.2 2.1
Europe 7.2 4.1
North America 5.5 1.1

but my program is giving output as

 
Asia 5.2 2.1 Europe 7.2 4.1 North America 5.5 1.1

Change the Content-Type to text/plain and re-try:

echo "Content-Type: text/plain"

Sounds like a cr/lf (carriage return & line feed) issue common when sharing files between unix and other systems.
There are utilities that will correct for this.

Also, I know that I sometimes get different views of the same unix-created file if I open with Windows Notepad or Wordpad.

Thanks a lot bipin it worked.

---------- Post updated 01-15-13 at 09:47 AM ---------- Previous update was 01-14-13 at 11:08 AM ----------

How to remove unwanted information from the file and send over the mail.

file has below details

ABC gzip -dc /var/opt/home/smith/buffer.gz /opt/smith.gz (Asia)|(Europe)|(North America)
ABC Asia 5.2
ABC Europe 7.2
ABC North America 5.5

than the mail should have theformat as

ABC Asia 5.2 2.1
ABC Europe 7.2 4.1
ABC North America 5.5 1.1

I want to remove the line mentioned below when sending over e-mail

 
ABC gzip -dc /var/opt/home/smith/buffer.gz /opt/smith.gz (Asia)|(Europe)|(North America)

Use awk to skip the first line and print:

awk 'NR>1' filename

Or use awk to remove line containing pattern gzip

awk '!/gzip/' filename

thanks a lot Bipin below mnetioned commad worked

 
awk '!/gzip/' filename

but the other one awk 'NR>1' filename does not worked my file had data mentioned below and i wanted to remove gzip line from all.

ABC gzip -dc /var/opt/home/smith/buffer.gz /opt/smith.gz (Asia)|(Europe)|(North America)
 
ABC Asia 0.2 1 0 
ABC Europe 6.2 2 1
ABC North America 1.5 2 1 1 
 
ABC gzip -dc /var/opt/home/smith/buffer.gz /opt/smith.gz (Asia)|(Europe)|(North America)
 
ABC Asia 1.2 0 1 1
ABC Europe 3.2 1 1 1 
ABC North America 2.5 1 1 1
 
ABC gzip -dc /var/opt/home/smith/buffer.gz /opt/smith.gz (Asia)|(Europe)|(North America)
 
ABC Asia 1.2 0 1 1 3 3 3 3
ABC Europe 3.2 1 1 1 3 3 3 3
ABC North America 2.5 1 1 1 3 3 3 3