Help with underline text based on specific region


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with underline text based on specific region
# 1  
Old 03-13-2013
Help with underline text based on specific region

Input file
Code:
2 5 ASFGEWTEWRQWEQ
10 20 QEWIORUEIOUEWORUQWEQWRQRQWGQWGFQ
1 6 WRQTQWTQTQWTQT

Desired output file
Code:
2 5 ASFGEWTEWRQWEQ
10 20 QEWIORUEIOUEWORUQWEQWRQRQWGQWGFQ
1 6 WRQTQWTQTQWTQT

Column 1 is the start region of underline the text in column 3;
Column 2 is the end region of underline the text in column 3;
Do anybody experience underline text in unix by command line?
I'm plan to underline the region in column 3 based on the info shown in column 1 and 2.

Thanks.
# 2  
Old 03-13-2013
Plain text files do not have underlined regions.You can have that in either formatable text, e.g. html, rtf, or on screen / terminal. What do you want?
# 3  
Old 03-13-2013
Question: Do you want this to work on many terminals, or just yours?

Underline is a fairly odd attribute which may not work the same way on all terminals, if they support it at all. Changing the color has more broad support.

And if you want to store this in a text file, you probably shouldn't be using terminal color/format attributes at all. Text is text.
# 4  
Old 03-13-2013
Hi Corona688,

I work on terminal right now.
My OS is ubuntu.
I have a normal *.txt file which I need to underline all the column 3 region based on column 1 and column 2 info.
I just wondering how to use command line to "highlight" all those interested region in a one run instead of one by one manual check and edit it.

If underline is difficult to archive, either highlight with color, bold or italic those specific region should be fine too.

Thanks a lot.

---------- Post updated at 06:14 PM ---------- Previous update was at 06:13 PM ----------


Hi RudiC,

I work on terminal right now.
My OS is ubuntu.
I have a normal *.txt file which I need to underline all the column 3 region based on column 1 and column 2 info.
I just wondering how to use command line to "highlight" all those interested region in a one run instead of one by one manual check and edit it.

If underline is difficult to archive, either highlight with color, bold or italic those specific region should be fine too.

Thanks a lot.

Quote:
Originally Posted by RudiC
Plain text files do not have underlined regions.You can have that in either formatable text, e.g. html, rtf, or on screen / terminal. What do you want?
# 5  
Old 03-15-2013
When editing that file manually, what do you modify/insert to achive underline?
# 6  
Old 03-18-2013
Hi RudiC,

What I did was I open the *.txt through Microsoft Excel.
After then I underline or italic the region of column 3 based on column 1 and column 2 information.
But it is a bit tedious if I wanna to edit a long list of data Smilie

Do you have any idea or advice?
My main purpose was just wanna to automatic "highlight" those region based on column 1 and column 2 info.
It can be bold or italic those region.
As long as it look "special" from normal word.
# 7  
Old 03-18-2013
cpp_beginner,
If you will be importing the text file into Excel, one solution would be to write an Excel formula or some VBA code to handle the underlining part.
This User Gave Thanks to mjf For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert header with underline?

How to insert header with underline AM able to insert only header not underline sed '1i NAME COUNTRY' test.txt input file UK 1234 USA 2354 AUS 2253 IND 4256 Output file NAME COUNTRY_CODE ---- ------------ UK 1234 USA 2354 AUS 2253 IND 4256 (5 Replies)
Discussion started by: Kalia
5 Replies

2. UNIX for Dummies Questions & Answers

How to cut from a text file based on value of a specific column?

Hi, I have a tab delimited text file from which I want to cut out specific columns. If the second column equals one, I want to cut out columns 1 and 5 and 6. If the second column equals two, I want to cut out columns 1 and 5 and 7. How do I go about doing that? Thanks! (4 Replies)
Discussion started by: evelibertine
4 Replies

3. Shell Programming and Scripting

Help with allocated text content based on specific rules...

Input file format: /tag="ABL" /note="abl homolog 2 /tag="ABLIM1" /note="actin binding LIM 1 /tag="ABP1" /note="amiloride binding protein 1 (amine oxidase (copper- containing)) /tag="ABR" /note="active BCR-related /tag="AC003042.1" /note="SDR family member 11 precursor . . . (4 Replies)
Discussion started by: perl_beginner
4 Replies

4. Shell Programming and Scripting

Assigning a specific format to a specific column in a text file using awk and printf

Hi, I have the following text file: 8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm 9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm 10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm 11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies

5. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

6. Shell Programming and Scripting

Bold and Underline - not displyed in more/less/vi

I have a script main.shl which has few lines like this #bold tput smso echo "\t\tsome statement\t\t" tput rmso I am executing the main.shl from the shell and redirected its output to a separate file like this $main.shl >main.log 2>&1 & once after running this script, if I "cat" the... (0 Replies)
Discussion started by: ramkrix
0 Replies

7. Shell Programming and Scripting

Extract lines of text based on a specific keyword

I regularly extract lines of text from files based on the presence of a particular keyword; I place the extracted lines into another text file. This takes about 2 hours to complete using the "sort" command then Kate's find & highlight facility. I've been reading the forum & googling and can find... (4 Replies)
Discussion started by: DionDeVille
4 Replies

8. Shell Programming and Scripting

Insert a text from a specific row into a specific column using SED or AWK

Hi, I am having trouble converting a text file. I have been working for this whole day now, still i couldn't make it. Here is how the text file looks: _______________________________________________________ DEVICE STATUS INFORMATION FOR LOCATION 1: OPER STATES: Disabled E:Enabled ... (5 Replies)
Discussion started by: Issemael
5 Replies

9. Shell Programming and Scripting

Underline

i want to print underline under a text using shell or awk.can any body help me regarding this problem? i hav tried with echo -e -n "\033$4}' like expected output is 123 456 12 122 567 13 211 087 14 311 987 15 like the avove Thank you regards, Pankaj. (2 Replies)
Discussion started by: panknil
2 Replies

10. UNIX for Dummies Questions & Answers

underline character in vi editor

I want to print a man page for a command in unix, this is what I did man command > command.txt but when I view the output file command.txt I found there are lot of _^H characters that in the man page are actually underline character, how can I replace this _^H with underline character? ... (2 Replies)
Discussion started by: Melissa
2 Replies
Login or Register to Ask a Question