Page 1 of 1

Suggestion: Add left/right margin using external file or internal table

Posted: Thu May 14, 2020 12:48 am
by dfhtextpipe
Here's an idea to consider:

A choice could be made in the filter UI to use either an internal table or an external file.

An external file would be (e.g.) tab-delimited, just like a replace file.

It would work as follows:
  • Column 1 would contain a series of Restrict to line number specifications.
  • Column 2 would contain the respective text to be added at the left (or right) margin.

Code: Select all

1..1071	Matthew 
1072..1749	Mark 
1750..2897	Luke 
2898..3776	John 
3777..4783	Acts 
4784..5216	Romans 
5217..5653	1 Corinthians 
5654..5910	2 Corinthians 
5911..6059	Galatians 
6060..6214	Ephesians 
6215..6318	Philippians 
6319..6413	Colossians 
6414..6502	1 Thessalonians 
6503..6549	2 Thessalonians 
6550..6662	1 Timothy 
6663..6745	2 Timothy 
6746..6791	Titus 
6792..6816	Philemon 
6817..7119	Hebrews 
7120..7227	James 
7228..7332	1 Peter 
7333..7393	2 Peter 
7394..7498	1 John 
7499..7511	2 John 
7512..7525	3 John 
7526..7550	Jude 
7551..7955	Revelation 
In the above table, each line ends with a space.

It would be thus be a single filter to replace the following set of 27 filter pairs:

Code: Select all

Comment...
|  Add English booknames to each line for VPL format
|
|--Restrict lines:1..1071
|  |
|  +--Add left margin [Matthew]
|      
|--Restrict lines:1072..1749
|  |
|  +--Add left margin [Mark]
|      
|--Restrict lines:1750..2897
|  |
|  +--Add left margin [Luke]
|      
|--Restrict lines:2898..3776
|  |
|  +--Add left margin [John]
|      
|--Restrict lines:3777..4783
|  |
|  +--Add left margin [Acts]
|      
|--Restrict lines:4784..5216
|  |
|  +--Add left margin [Romans]
|      
|--Restrict lines:5217..5653
|  |
|  +--Add left margin [1 Corinthians]
|      
|--Restrict lines:5654..5910
|  |
|  +--Add left margin [2 Corinthians]
|      
|--Restrict lines:5911..6059
|  |
|  +--Add left margin [Galatians]
|      
|--Restrict lines:6060..6214
|  |
|  +--Add left margin [Ephesians]
|      
|--Restrict lines:6215..6318
|  |
|  +--Add left margin [Philippians]
|      
|--Restrict lines:6319..6413
|  |
|  +--Add left margin [Colossians]
|      
|--Restrict lines:6414..6502
|  |
|  +--Add left margin [1 Thessalonians]
|      
|--Restrict lines:6503..6549
|  |
|  +--Add left margin [2 Thessalonians]
|      
|--Restrict lines:6550..6662
|  |
|  +--Add left margin [1 Timothy]
|      
|--Restrict lines:6663..6745
|  |
|  +--Add left margin [2 Timothy]
|      
|--Restrict lines:6746..6791
|  |
|  +--Add left margin [Titus]
|      
|--Restrict lines:6792..6816
|  |
|  +--Add left margin [Philemon]
|      
|--Restrict lines:6817..7119
|  |
|  +--Add left margin [Hebrews]
|      
|--Restrict lines:7120..7227
|  |
|  +--Add left margin [James]
|      
|--Restrict lines:7228..7332
|  |
|  +--Add left margin [1 Peter]
|      
|--Restrict lines:7333..7393
|  |
|  +--Add left margin [2 Peter]
|      
|--Restrict lines:7394..7498
|  |
|  +--Add left margin [1 John]
|      
|--Restrict lines:7499..7511
|  |
|  +--Add left margin [2 John]
|      
|--Restrict lines:7512..7525
|  |
|  +--Add left margin [3 John]
|      
|--Restrict lines:7526..7550
|  |
|  +--Add left margin [Jude]
|      
+--Restrict lines:7551..7955
   |
   +--Add left margin [Revelation]
How easy would that be to implement?

Best regards,

David

Re: Suggestion: Add left/right margin using external file or internal table

Posted: Thu Jul 09, 2020 1:32 am
by dfhtextpipe
Awaiting a response!

Re: Suggestion: Add left/right margin using external file or internal table

Posted: Wed Sep 23, 2020 9:42 pm
by DataMystic Support
Hi David,

This is highly specific - I would have though this was much easier to do with a scripting filter.

Re: Suggestion: Add left/right margin using external file or internal table

Posted: Thu Oct 08, 2020 4:16 am
by dfhtextpipe
Hi Simon,

The illustrative example was highly specific yet I feel sure that the same concept could be very useful in other contexts.

David

Re: Suggestion: Add left/right margin using external file or internal table

Posted: Thu Oct 08, 2020 6:09 am
by DataMystic Support
Thanks David, I am happy to reconsider if there is a broader base of use-cases.