Text File error in email


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Text File error in email
# 1  
Old 07-10-2006
Text File error in email

Hi,

I am trying to send a csv and txt file as attachment from AIX using a script, csv file ssent out correctly but for txt the data comes in one line and it could not retain the same format data it ends up showing all the data in single line. It has these junk chars for new line...is there any way to remove these junk for new lines...
here is how I am sending the file...
Code:
uuencode test.txt Today_test.txt | mail -s "Today File" mail@id.com

is there any way to remove these junk chars...

Thanks,
# 2  
Old 07-11-2006
If the csv comes from Winodws and the chars look like ^M in vi, then
Code:
dos2ux  test.txt > tmp.tmp
uuencode tmp.tmp Today_test.txt | mail -s 'file' you@some.com

dos2ux maybe called dos2unix on your box.
# 3  
Old 07-11-2006
# 4  
Old 07-12-2006
Even if you use the essential dos2unix command there is a possibility that text will come in one line.The solution is to open the file in notepad and do word wrap option.that will bring output in different lines.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies

2. UNIX for Beginners Questions & Answers

Check Error File attach and email zip file

I need something to say if these two file extensions exist in this directory *err and *rpt zip up these files into one zip file and email them to me. If they don't exist wait 2 hours and check again.... Not sure how to determine if I need to do an if then statement or a while true or a for... (1 Reply)
Discussion started by: xgringo
1 Replies

3. Shell Programming and Scripting

Read a file, add some text and send an email

Hi, If I am asking this question, you must have already figured out , that I am new to Unix, so here it goes I was trying to read a file, add some user defined content to it and send out an email , I did find out a way to achieve this, but looking at the code, it looks a bit crude to me, can... (3 Replies)
Discussion started by: karthikbhuvana
3 Replies

4. Shell Programming and Scripting

Trying to email text, getting blank email

Hello, and thank you for help in advance, i seem to have this script working, except for the email part, it sends me a blank email, am i not redirecting the output of my text file the right way? #!/usr/bin/ksh rm installed_zones.txt installed=/home/xxx/stuff/installed_zones.txt for... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

5. Shell Programming and Scripting

help with email to be triggered based on fatal error detection from batch run log file neded

Hi, I require need help in two aspects actually: 1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
Discussion started by: zico1986
1 Replies

6. Shell Programming and Scripting

Capture all error message in Log file and send the Log file by email

Hi I have a requirement to write a script to capture all errors in a Logfile and send the file in email. If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS. So I created a Log file and put the Appropriate... (2 Replies)
Discussion started by: dgmm
2 Replies

7. Shell Programming and Scripting

Write a scripts to kill idle user for 60 min. & email user list to admin in text file

Folks, I have written one script for following condition by referring some of online post in this forum. Please correct it if I'm missing something in it. (OS: AIX 5.3) List the idle user. (I used whoidle command to list first 15 user and get username, idle time, pid and login time).... (4 Replies)
Discussion started by: sumit30
4 Replies

8. Shell Programming and Scripting

Problem with sending email(to include contents of text file)

Hello, I was using a shell script for sending contents of a text file(email.report) to different users. I was using the below command in my script to send email... cat email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com It was working fine all these days but now all of a sudden it... (18 Replies)
Discussion started by: smarty86
18 Replies

9. UNIX for Dummies Questions & Answers

Bold Text In Email

Hello, I email some info daily to my employees using a script. But they tend to overlook an important part so I wanted to bold that particular section. Everyone here uses outlook to receive their emails. I would like to know how to send an email to my employees with some parts in bold. (3 Replies)
Discussion started by: Amonkira
3 Replies

10. Shell Programming and Scripting

awk error in sorting text file

Hi Having a file as below file.txt error Server Network Name Dept Date Time =========================================================================================================================== 0 ServerA LAN1 AAA IT01 04/30/2008 09:16:26 0 ... (3 Replies)
Discussion started by: karthikn7974
3 Replies
Login or Register to Ask a Question