Jump to content

Please read the Forum Rules before posting.

Photo
- - - - -

Formatting problems


  • Please log in to reply
17 replies to this topic

#1 BaptizedBeliever

BaptizedBeliever

    Christian

  • Members (T)
  • PipPipPipPipPip
  • 924 posts
Offline

Posted 05 December 2011 - 11:04 PM

I am trying to convert another Bible (NT) to e-Sword. The text, though, it somewhat screwy. Copied from a pdf file, the text goes something like this:

26 Truly I say to you, you will absolutely not get out of there until you have paid the last quadrans. Adultery and Divorce
27 You have heard that it was said, Do not commit adultery,

This is after already formatting to have the verse numbers start at the beginning of each line. My question is this: is there a way (in Word) to find all the text in BOLD and ITALICS together (ending in a paragraph break), and then insert a paragraph break before them and a line break afterwards?

What must I put in the "replace" box in order to not actually replace the text?

I know I will likely have do much of this by hand, but I'm wanting to end up with text looking like this (note the heading moved to a new line):

26 Truly I say to you, you will absolutely not get out of there until you have paid the last quadrans.
Adultery and Divorce
27 You have heard that it was said, Do not commit adultery,

And if there is a quick and easy way to move the heading into the verse to which it applies, that'd be nifty as well...

26 Truly I say to you, you will absolutely not get out of there until you have paid the last quadrans.
27 Adultery and Divorce
You have heard that it was said, Do not commit adultery,

I hope this makes some sense. I am attaching a sample of Matthew 5-7 so you know what I'm dealing with.

Brad

Edited by Cobb78, 05 December 2011 - 11:05 PM.


#2 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,891 posts
  • LocationGallatin, TN
Offline

Posted 05 December 2011 - 11:25 PM

There could be a better way to do this. But at a quick glance, this will work:

search: ([a-zA-Z ’]{1,100})
(specify bold/italics font)

replace: ^p\1^p

the ^p's in our replacement text can be tweaked to your liking. You might want ^p^p\1^p for an extra line at the beginning.

This will work as long as there isn't any odd punctuation or characters in the bold/italicized text. Notice I account for lower case text (a-z) and uppercase text (A-Z) and an apostrophe. If there's other characters, put it in the list.

EDIT: Here's a better search to account for numbers too, should they appear in the text:

search: ([a-zA-Z0-9 ’]{1,100})

Attached File  brad.jpg   176.6K   8 downloads

Edited by Josh Bond, 05 December 2011 - 11:31 PM.


#3 patchworkid

patchworkid

    Resource Builder

  • Members (T)
  • PipPipPipPipPip
  • 1,554 posts
  • LocationOld England
Offline

Posted 06 December 2011 - 04:44 AM

Hi Josh,

I have another problem


1 ¶ The book of the generation of Jesus Christ, the son of David, the son of Abraham.
Matthew 1:1
A Commentary or Exposition Upon The Gospel According to St. Matthew,
Where in the text is explained, some controversies are briefly discussed, Various common places handled, and many remarkable matters hinted, that had been by former interpreters omitted
Ver. 1. The Book] That is, a roll or register, catalogue or calendar, a ciphering and summing up. (Ge 5:1, tdlwt rpo xz auth h biblov genexewv.)

I need the Bold Matthew 1:1 to go to the top of 1 ¶ The book of the generation of Jesus Christ, the son of David, the son of Abraham. So I can make the commentary.

I am using search (Matthew 1:[0-9]) with Wild cards ; font - bold replace (i don't know) I want to move to the top but what you showed Cobb was to move to the bottom or next line. If I can get this done right I can do the John Trapps NT Cmt quickly.

Again This is what I want it to look like


÷Matthew 1:1

1 ¶ The book of the generation of Jesus Christ, the son of David, the son of Abraham.

A Commentary or Exposition Upon The Gospel According to St. Matthew,
Where in the text is explained, some controversies are briefly discussed, Various common places handled, and many remarkable matters hinted, that had been by former interpreters omitted

Ver. 1. The Book] That is, a roll or register, catalogue or calendar, a ciphering and summing up. (Ge 5:1, tdlwt rpo xz auth h biblov genexewv.)

thanks
Patchworkid
Merismos the Scriptures with Patchworkid's Study Bible Set<p>http://www.biblesupp...tudy-bible-set/, MySword -http://www.biblesupp...tudy-bible-set/

#4 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,891 posts
  • LocationGallatin, TN
Offline

Posted 06 December 2011 - 09:51 AM

Without having a real sample of the text in a file, I would say this should work:

search: ([0-9]{1,3} ¶*^13)(*^13)

replace: \2^p\1

It searches for a digit 1 to 3 times (that would be your verse number), a space, then the paragraph symbol, then any characters, then it looks for the line break (^13). Then the second set of paranthesis captures the second line to the line break, which should be the Matthew reference. That's a lot of assumptions to make but it should work if all the text is like this....

The replacement just flips the text captured in parenthesis around--verse reference first, then a new paragraph, then the line with the small verse number, paragraph symbol, and text.

#5 patchworkid

patchworkid

    Resource Builder

  • Members (T)
  • PipPipPipPipPip
  • 1,554 posts
  • LocationOld England
Offline

Posted 06 December 2011 - 10:56 AM

HI Josh,

here is the doc Attached File  Matthew 1.zip   34.66K   4 downloads

can you please look at it to change matthew 1:1 to the top

thanks
Merismos the Scriptures with Patchworkid's Study Bible Set<p>http://www.biblesupp...tudy-bible-set/, MySword -http://www.biblesupp...tudy-bible-set/

#6 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,891 posts
  • LocationGallatin, TN
Offline

Posted 06 December 2011 - 11:22 AM

The search/replace I recommended above seems to work fine. What's the problem?

#7 BaptizedBeliever

BaptizedBeliever

    Christian

  • Members (T)
  • PipPipPipPipPip
  • 924 posts
Offline

Posted 06 December 2011 - 11:45 AM

Can someone tell me how to create a macros for Word? I want to be able to hit ctrl-m to place the division symbol, just like in ToolTip.

It's Word 2010, in case that matters.

Brad

Edited by Cobb78, 06 December 2011 - 11:46 AM.


#8 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,891 posts
  • LocationGallatin, TN
Offline

Posted 06 December 2011 - 12:44 PM

Word 2010:
  • Click View from the main menu (horizontal menu).
  • Choose the down arrow of the Macros icon (far right icon).
  • Record a macro. Specify the name of the macro. Click the button option/icon to assign a CTRL-M to this macro. The recording begins...
  • Bring the search/rep
  • Stop the recording by clicking the macros icon and clicking stop recording.

It should work now.

Oh you want it to paste ÷ no matter what's on the clipboard. Let me google that for ya...

#9 BaptizedBeliever

BaptizedBeliever

    Christian

  • Members (T)
  • PipPipPipPipPip
  • 924 posts
Offline

Posted 06 December 2011 - 12:53 PM

Sorry, didn't mean to be confusing. (smacks self with his 26-year old hardback Open Bible: Expanded Edition KJV).

Brad

#10 Josh Bond

Josh Bond

    Administrator

  • Administrators
  • PipPipPipPipPip
  • 2,891 posts
  • LocationGallatin, TN
Offline

Posted 06 December 2011 - 01:17 PM

No worries.

It's easy to do, just Visual Basic is so "nerfed" I make things way harder than they need to be (because I'm used to C++). I always have to look up Visual Basic syntax.

There's 2 parts to this:

1) Install the Macro.

2) Assign a shortcut (CTRL-M) to the macro.


Install this Macro:
Sub InsertT3()

Dim myText As String

'Insert text
myText = "÷"

Selection.TypeText (myText)
End Sub


Click View from main menu, then click the Macros icon (far right). Edit any macro you can. On the resulting window, scroll all the way to to bottom (past everything else) and paste the macro above.

To avoid confusion, I blacked out my other macros. You paste what's in the red box (quoted above) at the bottom of the screen, as shown in the screenshot.
Attached File  install_macro_code.png   91.76K   3 downloads

Assign the Hotkey
1) Click File > Options > Customize Ribbon
2) At the bottom, click Keyboard Shortuts: Customize button.
3) Select "Macros" from the left window pane.
4) Select "InsertT3" from the right window pane (InsertT3 is the name of the macro you just installed).
5) Click the "Press new Shortcut key field" and press CTRL-M
6) Click the Assign Button.
7) Close this window and click OK on the others to return to the word processor.

Attached File  assign_hotkey_macro.png   136.08K   2 downloads




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users




Similar Topics



Latest Blogs