Re: how to strip HTLM from word doc on mac?

2013-08-10 Thread LuKreme
On 09 Aug 2013, at 12:57 , TJ Luoma luo...@gmail.com wrote:
 The advantage of using `lynx` instead of trying to create your own solution 
 is that it has been designed to deal with all sorts of 'edge cases' of weird 
 and/or badly written HTML.

I have to say that I prefer links to lynx by quite a wide margin and have found 
that it handles more compacted pages in general than lynx. However, for the 
purposes of --dump, it's probably not a big difference.

Both are in MacPorts.

-- 
On a scale of one to ten, it sucked.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit

--- 
You received this message because you are subscribed to the Google Groups 
BBEdit Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.




Re: Digest for bbedit@googlegroups.com - 5 Messages in 1 Topic

2013-08-10 Thread Spencer Stone
I use a program called Plain Clip and assign a keystroke combination in 
Butler to execute the paste.  Plain Clip strips all the formatting.
On Aug 10, 2013, at 8:43 AM, bbedit@googlegroups.com wrote:

   Today's Topic Summary
 Group: http://groups.google.com/group/bbedit/topics
 
 how to strip HTLM from word doc on mac? [5 Updates]
  how to strip HTLM from word doc on mac?
 SBD davie...@gmail.com Aug 09 10:19AM -0700  
 
 I'm looking for a way to strip all codes (I want plain text) from things I 
 have copy/pasted into a word doc on my Mac. I understand this can be done 
 by using Notepad on PCs, but I'm not able to figure this out via my new 
 Mac. Any suggestions? Thanks!
  
 Ted Burger t...@tobsupport.com Aug 09 01:34PM -0400  
 
 Simply use BBEdit to remove markup.
  
 Thanks,
 Ted
 *** Ted Burger 
 t...@tobsupport.com * www.tobsupport.com
  
  
  
 On Aug 9, 2013, at 1:19 PM, SBD wrote:
  
  
 David Kelly dke...@hiwaay.net Aug 09 12:48PM -0500  
 
 
  I'm looking for a way to strip all codes (I want plain text) from things I 
  have copy/pasted into a word doc on my Mac. I understand this can be done 
  by using Notepad on PCs, but I'm not able to figure this out via my new 
  Mac. Any suggestions? Thanks!
  
 Don't know about Word but many applications have an Edit - Paste And Match 
 Style function which strips styling from the clipboard's contents during 
 paste.
  
 Or has already been suggested, copy into BBedit (or TextWrangler), then copy 
 from BBedit back into Word.
  
 Oooh! I know! Open Terminal.app. Type cat  file.txt. Paste. Type ^C 
 (control-C). Merge file.txt into your Word document. :-)
  
 --
 David Kelly N4HHE, dke...@hiwaay.net
 
 Whom computers would destroy, they must first drive mad.
  
 Bruce Van Allen b...@cruzio.com Aug 09 10:54AM -0700  
 
 things I have copy/pasted into a word doc on my Mac. I understand
 this can be done by using Notepad on PCs, but I'm not able to figure
 this out via my new Mac. Any suggestions? Thanks!
  
 The obvious answer on this list is: open the file with BBEdit 
 and use its abilities to strip markup.
  
 You could also simply call Save As... in Word, and choose the 
 format Plain Text.
  
 HTH
  
  
 Best Regards,
  
 - Bruce
  
 _bruce__van_allen__santa_cruz_ca_
  
 TJ Luoma luo...@gmail.com Aug 09 02:57PM -0400  
 
 On 9 Aug 2013, at 13:19, SBD wrote:
  
  things I have copy/pasted into a word doc on my Mac.  I understand 
  this can be done by using Notepad on PCs, but I'm not able
  to figure this out via my new Mac.  Any suggestions?  Thanks!
  
 There have been plenty of good suggestions made already, but I'll add 
 one specific to BBEdit:
  
 1. Download and install this to BBEdit's Text Filters folder:
  
 https://github.com/tjluoma/bbedit/blob/master/Text-Filters/HTML-to-Plain-Text.sh
  
 2. Install lynx (if it isn't already)
  
 http://code.google.com/p/rudix/wiki/lynx
  
 And then you can use BBEdit's Text Filter feature to convert any HTML 
 document to plain text.
  
 The advantage of using `lynx` instead of trying to create your own 
 solution is that it has been designed to deal with all sorts of 'edge 
 cases' of weird and/or badly written HTML.
  
 TjL
  
 
 -- 
 This is the BBEdit Talk public discussion group. If you have a 
 feature request or would like to report a problem, please email
 supp...@barebones.com rather than posting to the group.
 Follow @bbedit on Twitter: http://www.twitter.com/bbedit
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 BBEdit Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to bbedit+unsubscr...@googlegroups.com.
 To post to this group, send email to bbedit@googlegroups.com.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit

--- 
You received this message because you are subscribed to the Google Groups 
BBEdit Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.


Soft Wrap and search replace project file

2013-08-10 Thread Joshua Wilson
Hello,

I work with very large log files and I would like to work on their 
formatting a bit.  I open up the a folder and then there are several other 
folders inside of it.  So I drag the main folder to the BBEdit icon and 
open it up as a project.  The main files I'm interested in are xyz.log, 
then xyz.log.1, xyz.log.2 (and so on to 48), but there are a few other 
files that I have to look at as well all in various folders in the project.

I have the language set to automatically apply as XML to xyz.log.  I 
couldn't get it to apply to xyz.log.1 .2 etc with a wildcard, so I just had 
to add .log.1 .log.2 etc for the language preferences.  No big deal. 
 However, it only seems to Soft Wrap xyz.log and when I do a multi file 
search, if I hit something on xyz.log.1 it does not soft wrap; and my 
engineers decided that text that spans 1000 characters long before wrapping 
is somehow a good idea.

Beyond this, I'm trying to automate a search and replace for a simple 
string but I guess I can't get the escape characters correct.
I have to deal with a lot of tags like 
blahvalue/blahblah2value2/blah2blah3value3/blah3
I found that an amazing simple search and replace where I replace  with 
\r results in
blahvalue/blah
blah2value2/blah2
blah3value3/blah3

It's amazing, and with the amount of data I have to read, a replace like 
this (and a soft wrap) makes so much difference in the amount of time it 
takes to go through these files.

I just can't get these either automated or mapped to a button (like to 
execute an apple script) that applies to all files in a project.

If I can just figure out what's wrong with the preferences to allow the xml 
formatting with the softwrap to actually apply to all files in the project, 
that'd be awesome.  Otherwise, can I programmatically do this?

I found a softwap that seems to work in AppleScript

*{{{*

*tell* *application* BBEdit

* set* project *to* *project document* 1

* tell* project

*  if* *not* (soft wrap text) *then*

* set* soft wrap text *to* true

* set* soft wrap mode *to* window width

* set* show page guide *to* false

* else*

* set* soft wrap text *to* false

* end* *if*

* end* *tell*
*end* *tell* 
}}}

But this does not apply to all items in a project.  

So is there any way to either fix my preferences to do the softwrap for the 
project or create an applescript that will both soft wrap to the window 
width as well as search and replace  with \r automatically or where I 
can at least bind it to a key?

Thanks

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit

--- 
You received this message because you are subscribed to the Google Groups 
BBEdit Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.


Re: Soft Wrap and search replace project file

2013-08-10 Thread Oliver Taylor
On Aug 10, 2013, at 1:34 PM, Joshua Wilson joshmit...@gmail.com wrote:

 So is there any way to either fix my preferences to do the softwrap for the 
 project

I can think of a few things that might help:

  1. Set BBEdit's default to soft-wrap
  2. Set a hot key for your soft-wrap preference

But having a number after your log files' extension is problematic.

 create an applescript that will both soft wrap to the window width as well as 
 search and replace  with \r automatically or where I can at least bind it 
 to a key?

The following applescript will do both, you can assign it a hot-key. There's 
probably a way to replace in the frontmost project, but I'm not certain how to 
do that.

tell application BBEdit
tell window 1 to set soft wrap text to true
replace  using \\n searching in text of front window options 
{search mode:grep, starting at top:true, wrap around:false, backwards:false, 
case sensitive:false, match words:false, extend selection:false}
end tell

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit

--- 
You received this message because you are subscribed to the Google Groups 
BBEdit Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.