Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 30 Jul 2014, 15:24
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Search for bold text in Bash?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
slavvo67

Joined: 12 Oct 2012
Posts: 340
Location: The other Mr. 305

PostPosted: Sun 09 Mar 2014, 02:56    Post subject:  Search for bold text in Bash?  

Is there any way to search in bash (maybe grep or sed?) for text that would be bold in say a word document, ABI Word document or maybe Libre or Open Office documents? What I'm really looking to do is identify bold text and copy the text and page # to a new file. Basically, saving me the time of creating a directory on a 200+ page document.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Sun 09 Mar 2014, 08:05    Post subject: Re: Search for bold text in Bash?  

slavvo67 wrote:
Is there any way to search in bash (maybe grep or sed?) for text that would be bold in say a word document, ABI Word document or maybe Libre or Open Office documents? What I'm really looking to do is identify bold text and copy the text and page # to a new file. Basically, saving me the time of creating a directory on a 200+ page document.


created an abiword text file slavvo67.abw containing
a bold text
and made bold the word bold

Open the the abw file in text editor geany and you will see how abiword is storing "bold". Then you might use grep.

Code:
# grep font-weight:bold slavvo67.abw
answered:
Code:
<p style="Normal" xid="2"><c>a </c><c props="font-weight:bold">bold</c><c> word</c></p>
#


There is a program that removes all tags elsewhere or just use sed.....
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 340
Location: The other Mr. 305

PostPosted: Sun 09 Mar 2014, 20:40    Post subject:  

L18L

Thanks. That was a step in the right direction!

I chopped out the other stuff with sed:

sed -e 's/.*>\(.*\)<.*/\1/'
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0402s ][ Queries: 11 (0.0035s) ][ GZIP on ]