Choose Currency:
Menu

Tab-Indented List Tutorial

Tab-Indented List Basics
A Tab-Indented List is a list that uses tab-stop indentations to display list hierarchy. It is a method of showing a 'parent > child' hierarchy that can easily be understood by human and by machine. A list may contain multiple levels of hierarchy. Each additional level is represented by one additional tab-stop. The image below shows a simple tab-indented list with the characters that are normally hidden or invisible (such tabs, spaces, and carriage-returns) on show to make the list easier to understand. TAB is indicated by the little '>>' symbol. SPACE is indicated by a dot or period. CARRIAGE RETURN/LINE FEED is indicated by a backwards-P at the end of each line. (Its called a 'Pilcrow'.)

A tab-indented Keyword List displayed in PSPad

The parent word 'Mammal' has a child word 'Pets'. We can see that 'Pets' is a child of 'Mammal' because it is indented to the right by one tab more than 'Mammal'. The word 'Pets' also has two lower levels of hierarchy that contain its child 'Dog', and its grandchild 'Fox Terrier'. The word 'Fox Terrier' is therefore a great-grandchild of 'Mammal'. This hierarchy can also be represented as 'Mammal > Pets > Dog > Fox Terrier'.

The parent word 'Mammal' has three more children: 'Primate', 'Rodent', and 'Tapirs'. We can see that this is the case as they are all on the same level of indentation as 'Pets'. The fact that 'Pets' has some extra entries below it before the word 'Primate' is encountered doesn't stop 'Primate' from being a child of 'Mammal'. The same rule equally applies to 'Rodent', and 'Tapirs'.

To find the parent of any word in the list, simply look to the left, and then follow the lines up until a word is encountered. This will be the word's parent. Move one step more to the left and follow the lines up to find the grand-parent, and so on. Try that for the entry 'Lowland Tapir', and you should see that its hierarchy can be represented as 'Mammal > Tapirs > Lowland Tapir'.

Adding Tab Indents to a Tab-Indented List
Sometimes we need to change the indentations of a Tab-Indented List on a global level, adding a tab to each line to indent it one more tab-stop to the right, or removing a tab on each line to re-position the list one more tab-stop to the left.

An example of this is when we wish to add an additional list, such as one of my many free Specialist Lists, to your copy of the Hierarchical Image Keyword Catalog. The Hierarchical Image Keyword Catalog has a special section provided for you to add your own data, called '[7 - SPECIALIST]'. You can see this at the bottom of the list on the 'Categories' page. To add an additional list below the 'SPECIALIST' category, you will need to add one extra indentation before appending it.

The quickest and most accurate way to do this is to use your Text Editor program's 'Search and Replace' tool. As before, my suggestion for a suitable Text Editor program is 'PSPad'. Its free to download and use, (though they do ask for a donation), and is just the thing when working with Tab-Indented Lists.

NB: When you start PSPad for the first time, click 'Settings > Program Settings > Editor (part 2)'. You should then check the box marked 'Real Tabs', and set the 'Tab Width' to 6 or more. I'd also recommend that you click 'Format > Font' and choose a fixed-width font, like Courier New.

As an example, lets say you want to add my 'Reptiles of the World' list to your copy of the Lightroom Keyword List. If we open the list of reptiles in PSPad, the first few lines will look like this:

Tab-indented list of Reptiles of the World

However, to position all entries to act as children of the category '[7 - SPECIALIST]' we need to indent them to the right by one tab-stop, so that the list looks like this:

Increasing the indentation in a tab-indented list

With a small list, it is easy just to type an extra tab-stop by hand, but for a list with many thousands of lines, this would take a long time. The 'Search and Replace' function of PSPad is easy to use, once you know how.

  1. Start the PSPad program and click 'File > Open' to open the list you wish to append to your main list.
  2. Click 'Search > Replace' or 'Control + H' to open the 'Replace' window.
  3. Click the '?' to the right of the 'Find' box, and choose 'start of line'. A caret '^' symbol will be added to the 'Find' box.
  4. Click the '?' to the right of the 'Replace' box, and choose 'tab'. The characters '\t' will be added to the 'Replace' box.
  5. Notice how the 'Regular Expressions' option has checked itself. Leave it like that, and make sure that 'Entire Scope' is chosen for the 'Direction' choice.
  6. Click 'OK' and each line in the entire list will have an extra tab added to the left of the line.

The image below shows PSPad's 'Replace' window as it looks with the settings needed to add an extra tab-stop.

Adding an extra tab indent with PSPad

Removing Tab Indents from a Tab-Indented List
Removing a complete column of tab-indentations from a Tab-Indented List is just as easy as adding them if you are using a text-editor such as 'PSPad'. In this example, we will use its 'Search and Replace' tool to do the task automatically. Here's how:

  1. Start the PSPad program and click 'File > Open' to open the list you wish to adjust.
  2. Click 'Search > Replace' or 'Control + H' to open the 'Replace' window.
  3. Click the '?' to the right of the 'Find' box, and choose 'start of line'. A caret '^' symbol will be added to the 'Find' box.
  4. Click the same '?' a second time, and choose 'tab'. The characters '\t' will be added after the caret.
  5. The 'Replace' box should be left empty. It is programer's logic that explains this: We wish to replace a tab with nothing, i.e. we wish to delete it.
  6. Notice how the 'Regular Expressions' option has checked itself. Leave it like that, and make sure that 'Entire Scope' is chosen for the 'Direction' choice.
  7. Click 'OK' and each line in the entire list will have its left-most column of tabs deleted.
Removing an extra tab indent with PSPad
Web design and photography by photo-keywords.com   ::   All images and pages on this site are © 2005 - 2017   ::   All rights reserved
Flag Counter