Soft As It Gets Forums   Welcome to the new Soft As It Gets Forums. You can get assistance here for our new product Surfulater,
and for ED for Windows

Go Back  Soft As It Gets Forums > Surfulater Customer Forums > Publishing and Sharing Content
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #1
Old 27th August 2007, 04:18 PM
pmowbray's Avatar
pmowbray pmowbray is offline
Senior Member
 
Join Date: Mar 2006
Location: Blue Mountains: Australia
Posts: 236
Default SUL2Text

SUL2Text is a small programme to extract the text from a KnowledgeBase and dump it into a text file. It requires the .Net2.0 libraries.

It started life over here as a proof of concept.

New in version 1.3.1:
+ Added $Level=<number>$ Variable
~ Minor GUI changes

New in version 1.2.2:
! Fixed the sort bug. Folders and Articles should now export in the same treeform as they are in SuL.
+ Added more extract variables (SeeAlso, Comments, etc)
+ Added quick-pick variable insert
~ Shortened variables (to make it easier to edit: Note: variables are case-sensitive)
+ Added output Template files (saves/loads folder/node output definitions)
+ Added Level variable: $Level=<string>$ will repeat the <string> n times dependant on the level of the Folder/Node.
+ Added ToolTips

New in version 1.1:
+ A lot more error checking and stripping of elements in the SuL File. Error report is available at Step 2.
+ Ability to define how Articles are output (it's pretty simple at the moment).
+ Ability to select a starting Node

The Article output can be adjusted with TextVariables and real text:
{NL}: outputs a new line
$TL$: outputs the title of the Folder/Article (not for simple notes though)
$BD$: outputs text text part, Notes for Folders, Text for Browser, etc.
Any Free Text: outputs as entered.

So for example:
{NL}$TL$:{NL}$BD${NL}----
Produces:
Code:
    
    Title:
    Body Text
    ----

Appreciate feedback...

Regs,
Perry
Attached Files
File Type: zip SuL2Text v1.1.zip (17.6 KB, 3 views)
File Type: zip SuL2Text v1.2.2.zip (20.3 KB, 3 views)
File Type: zip SuL2Text v1.3.1.zip (20.7 KB, 23 views)

Last edited by pmowbray : 6th September 2007 at 11:57 AM. Reason: Added new version
Reply With Quote
  #2
Old 29th August 2007, 06:47 AM
nevf's Avatar
nevf nevf is offline
Neville Franks - Chief Rocket Scientist
 
Join Date: Jan 2004
Location: Australia
Posts: 3,072
Thumbs up

Quote:
Originally Posted by pmowbray
SUL2Text is a small programme to extract the text from a KnowledgeBase and dump it into a text file.

It started life over here as a proof of concept. The new version is a lot more stable, although I wouldn't call it polished

New in version 1.1:
+ A lot more error checking and stripping of elements in the SuL File. Error report is available at Step 2.
+ Ability to define how Articles are output (it's pretty simple at the moment).
+ Ability to select a starting Node

The Article output can be adjusted with TextVariables and real text:
$NEWLINE$: outputs a new line
$TITLE$: outputs the title of the Folder/Article (not for simple notes though)
$TEXT$: outputs text text part, Notes for Folders, Text for Browser, etc.
Any Free Text: outputs as entered.

So for example:
$NEWLINE$$TITLE$:$NEWLINE$$TEXT$$NEWLINE$----
Produces:
Code:
 
Title:
Body Text
----

Appreciate feedback...

Regs,
Perry
Perry, Thanks for all your work on this. And Jai etc. for helping drive it. It is great to see you guys working out the requirements and putting together a solution. It should form a great basis for incorporating into SUL down the track.
__________________
Neville Franks,
Author of ED for Windows and Surfulater
Reply With Quote
  #3
Old 29th August 2007, 04:18 PM
pmowbray's Avatar
pmowbray pmowbray is offline
Senior Member
 
Join Date: Mar 2006
Location: Blue Mountains: Australia
Posts: 236
Default

I've just popped up version 1.2.2

Jak, I'm pretty sure this should fix your structure problems in the output? I'd like to know if it does, as it does here

New in version 1.2.2:
! Fixed the sort bug. Folders and Articles should now export in the same treeform as they are in SuL.
+ Added more extract variables (SeeAlso, Comments, etc)
+ Added quick-pick variable insert
~ Shortened variables (to make it easier to edit: Note: variables are case-sensitive)
+ Added output Template files (saves/loads folder/node output definitions)
+ Added Level variable: $Level=<string>$ will repeat the <string> n times dependant on the level of the Folder/Node.
+ Added ToolTips

Appreciate comments....
Reply With Quote
  #4
Old 5th September 2007, 08:13 PM
barabbas45 barabbas45 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 150
Default

Quote:
Originally Posted by pmowbray
I've just popped up version 1.2.2

Jak, I'm pretty sure this should fix your structure problems in the output? I'd like to know if it does, as it does here

New in version 1.2.2:
! Fixed the sort bug. Folders and Articles should now export in the same treeform as they are in SuL.
+ Added more extract variables (SeeAlso, Comments, etc)
+ Added quick-pick variable insert
~ Shortened variables (to make it easier to edit: Note: variables are case-sensitive)
+ Added output Template files (saves/loads folder/node output definitions)
+ Added Level variable: $Level=<string>$ will repeat the <string> n times dependant on the level of the Folder/Node.
+ Added ToolTips

Appreciate comments....
hi perry - i replied in our preview thread elsewhere... basically I was a little confused about using the quick-pick variables... i'll play with it a little more this week and will post back.
Also I think I did find a couple more sorting issues, but let me double check and i'll post back here. thanks!
Reply With Quote
  #5
Old 6th September 2007, 10:36 AM
pmowbray's Avatar
pmowbray pmowbray is offline
Senior Member
 
Join Date: Mar 2006
Location: Blue Mountains: Australia
Posts: 236
Default SuL2Text Export Templates

Export Templates were added in Version 1.1 and expanded in 1.2.2

The Basics
Currently there are two templates that can be created:

  1. The Folder template and
  2. The Article template.
Each template is defined using a text string, which can contain variables that will be replaced during the export process with other values.

If the text string is empty, then nothing will be exported.

If the text string does not contain any variables then the export will not contain any text from the SuL file.

The Variables
$TL$: Is replaced with the text from the Title in SuL
$BD$: Is replaced with the text from the Body, this is the Text section in IE, Clipboard, SimpleNote and Bookmark Articles, Implementation in CodeSnippet, Notes in Folders, Details in ToDo.
$SA$: Is replaced with the text from the SeeAlso section.
$AT$: Is replaced with the text from the Attachments section.
$RF$: Is replaced with the text from the Reference section.
$CM$: Is replaced with the text from the Comments section.
{NL}: Is replaced with a new line sequence.
{TAB}: Is repleced with a tab character.
$Level=<string>$: <string> is duplicated by the depth within the tree and replaces the whole variable.
$Level=<number>$: <number> is multiplied by the depth within the tree and replaces the whole variable.

Saving and Loading
Export templates can be saved and loaded later by using the appropriate buttons. Templates are stored where SuL2Text.exe is located.

Examples
The following examples use a simple SuL KnowledgeBase with one article (Titled 'HARD SURFACE TYPE GRADIENT/ SLOPE') which is in a subFolder (Titled 'Design Requirements') of the KnowledgeBase.

Example 1

Folder:="$Level=+ $Title: $TL${NL}Body: $BD${NL}"
Article:="$Level=> $Article: $TL${NL}Body:{NL}$BD${NL}"

Note:
  1. The $Level variable is different for Folders and Articles. Folders="+ " and Articles = "> "
  2. Note the use of {NL} to seperate different sections

Will produce:
Quote:
Title: KnowledgeBase
Body:
+ Title: Design Requirements
Body:
> > Article: HARD SURFACE TYPE GRADIENT/ SLOPE
Body:
HARD SURFACE TYPE GRADIENT/ SLOPE
Pathways/Bikeways: 1% - 8%
Entrance walks: 1% - 4%
Pedestrian Ramps: up to 8%
Stairs Consistent with the provisions of the Building
Code of Australia for relationships between
risers, goings and surface falls.
Ball play areas: 1% - 3%
Adventure Playground Pad 1% - 3% for major installations. Peripheral areas to be assessed on individual merits for slope, elements and other features at the discretion of the Manager Parks, Reserves and Landscape Services.
Terrace and sitting areas: 1% - 2%

All hard surfacing and areas external to building envelopes must be designed to provide appropriate stormwater management including a minimum cross fall of 1:50 away from built structures to a suitable collection point.
Example 2
Folder:=""
Article:="--{NL}$BD${NL}---{NL}"

Note:
  1. Folder="", i.e. an empty string, which means that nothing will be exported for folders.
  2. The Article body is wrapped in a "--" "---" pair.
Will Produce:
Quote:
--
HARD SURFACE TYPE GRADIENT/ SLOPE
Pathways/Bikeways: 1% - 8%
Entrance walks: 1% - 4%
Pedestrian Ramps: up to 8%
Stairs Consistent with the provisions of the Building
Code of Australia for relationships between
risers, goings and surface falls.
Ball play areas: 1% - 3%
Adventure Playground Pad 1% - 3% for major installations. Peripheral areas to be assessed on individual merits for slope, elements and other features at the discretion of the Manager Parks, Reserves and Landscape Services.
Terrace and sitting areas: 1% - 2%

All hard surfacing and areas external to building envelopes must be designed to provide appropriate stormwater management including a minimum cross fall of 1:50 away from built structures to a suitable collection point.
---
Example 3
Folder:="This is a folder (Depth=$Level=1$){NL}"
Article:="This is an Article, the textual contents being:{NL}$BD${NL}---{NL}"

Note:
  1. Folder will only export constant text plus the level the depth of the folder.
  2. The KnowledgeBase folder has a depth of 0, therefore no +'s will be exported.
Will Produce:
Quote:
This is a folder (Depth=0)
This is a folder (Depth=1)
This is an Article, the textual contents being:
HARD SURFACE TYPE GRADIENT/ SLOPE
Pathways/Bikeways: 1% - 8%
Entrance walks: 1% - 4%
Pedestrian Ramps: up to 8%
Stairs Consistent with the provisions of the Building
Code of Australia for relationships between
risers, goings and surface falls.
Ball play areas: 1% - 3%
Adventure Playground Pad 1% - 3% for major installations. Peripheral areas to be assessed on individual merits for slope, elements and other features at the discretion of the Manager Parks, Reserves and Landscape Services.
Terrace and sitting areas: 1% - 2%

All hard surfacing and areas external to building envelopes must be designed to provide appropriate stormwater management including a minimum cross fall of 1:50 away from built structures to a suitable collection point.
---

Last edited by pmowbray : 6th September 2007 at 11:26 AM.
Reply With Quote
  #6
Old 6th September 2007, 12:01 PM
pmowbray's Avatar
pmowbray pmowbray is offline
Senior Member
 
Join Date: Mar 2006
Location: Blue Mountains: Australia
Posts: 236
Default

I've just popped up verions 1.3.1, which has an added variable and a few GUI changes:
  1. Removed the confusing "Node" and replaced it with "Article"
  2. Renamed Step 3 to "Set Export Options"
  3. Added Text to the Export Template Import & Save button
I wrote a few words about the Export Template format and variables here.
Reply With Quote
  #7
Old 20th September 2007, 10:35 AM
barabbas45 barabbas45 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 150
Default

hi - finally had a chance to test SUL2TEXT v1.3.1. WOrked marvelously. This is really extremely helpful and handy. Virtually everything I put into SUL eventually comes out in order to go into Microsoft Word, and this makes that transition very easy. Now I can just readin a text file (which i'd reformat over again in Word anyway, since the text file out of SUL for me usually only contains "raw" data or snippets).

Thanks much for this. Everything seems to be working as far as I can tell. I've got a grip on the variables now as well.

Not to press my luck, but of course, SUL2WORD would rock (folder titles going in as MS WOrd "outline headings"; articles going in as lowest level outline). As I understand it, Word now uses XML files...

And of course, SUL2HTML (where an informational look-up tree can be exported directly to an html file or a set of html files, in the style of .chm files except accessible on a website instead of the desktop

Thanks for SUL2TEXT, totally rocks
Reply With Quote
  #8
Old 20th September 2007, 11:28 AM
pmowbray's Avatar
pmowbray pmowbray is offline
Senior Member
 
Join Date: Mar 2006
Location: Blue Mountains: Australia
Posts: 236
Default

Quote:
Originally Posted by jak68
hi - finally had a chance to test SUL2TEXT v1.3.1. WOrked marvelously. This is really extremely helpful and handy. Virtually everything I put into SUL eventually comes out in order to go into Microsoft Word, and this makes that transition very easy. Now I can just readin a text file (which i'd reformat over again in Word anyway, since the text file out of SUL for me usually only contains "raw" data or snippets).

Thanks much for this. Everything seems to be working as far as I can tell. I've got a grip on the variables now as well.
That's great to hear!!

I'd hoped that the variable thing wasn't too difficult, they're really just place holders.
Quote:
Originally Posted by jak68
Not to press my luck, but of course, SUL2WORD would rock (folder titles going in as MS WOrd "outline headings"; articles going in as lowest level outline). As I understand it, Word now uses XML files...
OK, no dramas, next time I sit down to do some SuL work I'll start it... you're right, it won't be too difficult.

The only issue is that it'll be limited to text output, as any graphics will be in the database. But that being said, it'd do most of what you need by the sounds of it.
Quote:
Originally Posted by jak68
And of course, SUL2HTML (where an informational look-up tree can be exported directly to an html file or a set of html files, in the style of .chm files except accessible on a website instead of the desktop

Thanks for SUL2TEXT, totally rocks
Did you give HTMLview a go? It's not really what you want, but it'd serve as a basis for export.

Perry
Reply With Quote
  #9
Old 20th September 2007, 03:41 PM
barabbas45 barabbas45 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 150
Default

Quote:
Originally Posted by pmowbray

I'd hoped that the variable thing wasn't too difficult, they're really just place holders.
Hi perry - as long as you're having fun with the project, perhaps at some point you could also create a small 'example file' that your script immediately auto-processes whenever the variables are changed -- so as to show the user a *visual* representation of the output text's formatting? That would be fun and very user friendly
Quote:
Originally Posted by pmowbray

Did you give HTMLview a go? It's not really what you want, but it'd serve as a basis for export.
I'll check that out next I think I looked at it once before but I need to refresh my memory...
Reply With Quote
  #10
Old 20th September 2007, 03:44 PM
barabbas45 barabbas45 is offline
Senior Member
 
Join Date: Feb 2007
Posts: 150
Default

(incidentally, I had a terrible case of dataloss, which is partly why I took so long to try out the script and respond... it appears that at some point I accidentally copied/overwrote my SUL database with an older version while I was moving some files around. It took me almost 3 weeks to rebuild it from memory. May this be a lesson to us all about keeping automatic backups with versioning. I have such a backup system but it had been temporarily set on manual. Tragedy was the result. Never ceases to amaze me how incredibly fragile computer data is.)
Reply With Quote
Reply


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 10:54 PM.


Powered by: vBulletin Version 3.0.0 Release Candidate 3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2004-2005, Soft As It Gets Pty Ltd