Making Text Bold


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Making Text Bold
# 1  
Old 12-01-2010
Making Text Bold

Hi Guys,

This is my first query here. I hope you could help.

I have a file as below

a 1 2 3 4
b 4 5 6
...

I need to print the first column of this in bold.
a 1 2 3 4
b 4 5 6
Is it possible, if so, could you please let me know how to do that?
I require this because I need to send the file via mail. It should look like
# 2  
Old 12-06-2010
Try this:
Code:
awk '$1="\033[40;37;1m"$1"\033[m"' file


If you want to use colors have a look at this post:
https://www.unix.com/302363387-post3.html
# 3  
Old 12-06-2010
Quote:
Originally Posted by praveen.munna
I require this because I need to send the file via mail.
Technically you can only depend on email being raw text, no fonts, no bold, no nothing. But on clients that support it, you may be able to use HTML, so it'd be something like this:

Code:
<html><body><pre>
<b>a</b> 1 2 3 4
<b>b</b> 4 5 6
</pre></body></html>

...of course, on clients that don't support it, they'll see it tags and all.

cabrao's solution, using escape sequences, will work only in the shell, it'll show garbage or nothing in an email.
# 4  
Old 12-06-2010
Oops, I didn't read the part saying that file would be sent by mail. In that case yes you need to use HTML, maybe something like this will help you:

Code:
awk '$1="<br><b>"$1"</b>"' file.txt > file.html


Last edited by cabrao; 12-06-2010 at 03:31 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bold text in Bash and send mail

I have a sample script here I want to bold the word BOLD in the text and send through email. Tried several ways but not seems to working. BODY="Hello. I want to BOLD this" { echo "From: from@gmail.com" echo "To: to@gmail.com" echo "Subject: Texting" ... (1 Reply)
Discussion started by: lpoolfc
1 Replies

2. Shell Programming and Scripting

output text in bold font using SED

hi I want to write a script, while using the SED editor, to output the text, in this case a variable, to the result file but highlighted it in bold, is it possible to do that? can you tell me how? eg. in text.txt sed '$ a\ '$variable' ' <text.txt >text2.txt so it will add the... (2 Replies)
Discussion started by: piynik
2 Replies

3. Shell Programming and Scripting

Format text to bold from perl script to csv

Hi everyone, is there any way in perl using which we can print the selective words in bold when we write the output to a csv file? Please find the example below 1. Filename: A 2. name age 12 3. city add 23 Line1 should only be bold. Outputs from other files being read in the... (2 Replies)
Discussion started by: ramakanth_burra
2 Replies

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

5. Shell Programming and Scripting

Making Some Characters in file BOLD

Hi All, I want to make some characters to be bold in a file. I have a file e.g aa.log which contains rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr gfgfgdaerqrqwrqerqwrwqwrqrqwrqr qqwerqwrqwrqwrqwrqwrqwrqwrq qwrqwrqwrqwrqwrqwrqwrqwrqwr File is too large to view Last line... (2 Replies)
Discussion started by: rajeshorpu
2 Replies

6. Shell Programming and Scripting

how can i bold a text

Dear i want to bold a text using shell script. please give sample.. Thanks rex (1 Reply)
Discussion started by: jrex1983
1 Replies

7. UNIX for Dummies Questions & Answers

how to make a bold text in vi

pls disregard got my question answered . as you can't do bold in vi (0 Replies)
Discussion started by: xzyan
0 Replies

8. UNIX for Dummies Questions & Answers

write data into a text file in bold format

Hi, can anyone help to write data into a text file in bold format and rollback to actual format. Thanks, Regards, Milton Y. (1 Reply)
Discussion started by: miltony
1 Replies

9. Programming

Bold text

hello, how do i display the text in the printf statement in bold. or is there anyway to display the text on the console in bold thx in advance svh (3 Replies)
Discussion started by: svh
3 Replies

10. UNIX for Dummies Questions & Answers

Bold Text?

Hello, On the linux box I use at work, the directories are bold type to distinguish them. Is there a way to make certain words in a text file bold? Thanks! (4 Replies)
Discussion started by: Atama
4 Replies
Login or Register to Ask a Question