Hi guys,
I am not experienced with Unix, so please dont mind if the question seem to be irrelevant.
I have written a simple script, that connects DB & fetches few records from a table. I wanted to get those details as file in .CSV format via mail.
-I stored the query o/p in a file.
-I squeezed all space character, then translated all space character into ',' (by help of 'tr' command only) [I know by this we can create .csv file]
-And finally I renamed the file into .CSV format (by mv command)
-But when I mailed that file as attachment (uuencode & mailx command), I am getting the data in strange format, some box symbols are appearing, though the data are OK but they are not readable properly.When I copy/paste those content in textpad, they are again visible fine.
Can someone please help me to view those data in .CSV file (or excel) in proper tabular format.
Thanks in adv.
are you using MS Outlook to view your email attachment ?
yes I am using MS outlook...does it make any difference...!
After all the attachment (.csv file) will be opened in MS Excel...
MS outlook has problems with decoding messages which are encoded using uuencode.
You can use -a option of mailx to send attachments instead of using uuencode.
Hi,
Is there any other way to send attachment except 'uuencode' ? Where do I need to use the '-a' option (in 'uuencode' or 'mailx') ?
Can you please give an example here ? If I want to send a file say "Report.csv" to "sumit@yahoo.com", then what would be the command ?
Thanks for the help.
mailx -s "subject" -a Report.csv sumit@yahoo.com < mail_body
Hi,
When I am using that command, I am getting the below error -
mailx: illegal option -- a
Usage: mailx -eiIUdFntBNHvV~ -T FILE -u USER -h hops -r address
-s SUBJECT -f FILE users
-Please help me out.