Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File distortion when mailing a file

Status
Not open for further replies.

johngiggs

Technical User
Oct 30, 2002
492
US
When I cat a file in UNIX the columns appear properly, however when I mail the file to my external mail account, the text isn't aligned properly. I have tried using mailx and mail.

Ex. UNIX file

Username Name Dir
=======================================
jim2 Jim Bob /users/jim2
joe7 Joe Schmoe /users/joe7

Ex. Mail file

Username Name Dir
======================================
jim2 Jim Bob /users/jim2
joe7 Joe Schmoe /users/joe7

The script that I am using uses awk, but I'm not sure if that has anything to do with it. Any help would be greatly appreciated.

Thanks,

John

 
A quick suggestion.

Is your external mail reader using a fixed-width font like courier, or a variable-width font like helvetica.

Spaces will only line up properly if you use a fixed-width font.
 
Try using tab (\t) as the separator in your awk script
eg printf("%s\t%s\t%s\n",$1,$2,$3)

Dickie Bird (:)-)))
 
Thanks, Dickie & Salem. I tried both solutions and they both worked. My default font was Arial, so when I changed it to Courier it displayed fine.

Thanks,

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top