Format data before i email it to the User


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Format data before i email it to the User
# 1  
Old 09-12-2008
Format data before i email it to the User

Hi,

i have a report which I basically need to format before i email it to the User.

it comrises of data in below format currently

YOMP_CSC_ASSESS_SCY062 cancelled
SOMO_Ckswed_ACEAMT_PC3 completed
SOMO_sdasf_TAX_ASSET completed
SOMP_CSC_ndksljfh_SCY060 cancelled

I need it in the below format everyime it is complied.

YOMP_CSC_ASSESS_SCY062 cancelled
SOMO_Ckswed_ACEAMT_PC3 completed
SOMO_sdasf_TAX_ASSET completed
SOMP_CSC_ndksljfh_SCY060 cancelled

<----------32 charachters--------->


Any assitance is much appreciated..Thanks,
# 2  
Old 09-12-2008
That will prove to be a problem, as you have more characters in your text than 32 (unless you remove stuff...

Code:
YOMP_CSC_ASSESS_SCY062 cancelled
SOMO_Ckswed_ACEAMT_PC3 completed
SOMO_sdasf_TAX_ASSET completed
SOMP_CSC_ndksljfh_SCY060 cancelled
################################
12345678901234567890123456789012

The last line has 34 chars (or 33 if you exclude the space)
# 3  
Old 09-13-2008
Hi.

If you are asking to require the length of each line to be folded after character 32, then use:
Code:
fold -w32 filename

if you want to break at words, then look at man fmt

If you are asking for the trailing line:
Code:
<----------32 charachters--------->

(sic), to appear in the output file, then that can be done with an echo appending to the output file:
Code:
echo >> outputfile
echo "<----------32 charachters--------->" >> outputfile

... cheers, drl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Sending Email in Excel Format

Hello, I am trying to send an email with the below attachment in .xls file format by default its opening everything in a single column in the email. How to display the column in a separate column in excel instead everything together. 2017/01/01 a 10 2017/01/01 b 20 2017/01/01 c 40... (6 Replies)
Discussion started by: Booo
6 Replies

2. Shell Programming and Scripting

Email Format Output issues

Hi Guys, I have written a script, which output information from email notfication. The output works fine in HTML format, but non-html format it is not shown in a human readable format. Can you help with the format *** Script echo " Server Name : $CLIENT_CHECK "... (4 Replies)
Discussion started by: Junes
4 Replies

3. Shell Programming and Scripting

EMAIL Format in UNIX

Hi , Need help of Email Format I have TEST .txt file which contains below data /home/a.DAT File Not received /home/a.CTL File Not received /home/b.DAT File Not received /home/b.CTL File Not received i am using below command to send mail mail -s "ERROR: files" $MAIL_LIST <... (6 Replies)
Discussion started by: satish1222
6 Replies

4. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

5. Shell Programming and Scripting

Check Date Format And Email Out

Hello All, I have a requirement where i need to get the EXTRACT_DATE from a file and check if the date is of valid format or not and then mail it if it is not valid. Appreciate if you can help me with this. I did the following so far. awk '{for(i=1;i++<=NF;)if($i~/^EXTRACT_DATE/) print $i}'... (11 Replies)
Discussion started by: Ariean
11 Replies

6. Shell Programming and Scripting

Using AWK to format output and email

Hello, I'm a bit stumped, for some reason when using AWK 'print' is not printing the entire date/line. awk '{print "Ticket #: " $1} {print "Queue : " $2} {print "Recieved : " $3} {print "AP Date : " $4} {print "Circuit ID : " $5} {print... (4 Replies)
Discussion started by: ArvinSodhi
4 Replies

7. Shell Programming and Scripting

Format the output to sent in Email

Hi I have a script #!/bin/sh # email addresses to send results to, separated by a space EMAILS="xxxx.yyyy@yahoo.com" SUBJECT="MySQL reporting " DISK_DATA_USAGE=/home/aaaa/usaage.txt mysql YYYYYYYY -e " select 100*sum(max_data_length) as disk_usage_pct from xxxxxx;" >... (2 Replies)
Discussion started by: asha210
2 Replies

8. 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

9. UNIX for Advanced & Expert Users

Send email as a different user than the user logged in

Hi I am using mailx to send email and am wondering if there is a way I can send the email from a different user than the user logged in. something like do-not-reply@xyz.com Thank you. (1 Reply)
Discussion started by: rakeshou
1 Replies

10. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies
Login or Register to Ask a Question