[Question]
  [
Here is an example of an input of **monoliths**. There are 4 in this example.
```
  _
 | |        _
 | |  _    | |
 | | | |   | |     _
_| |_| |___| |____| |_
```
The first monolith is 4 units high, the second is 2, the third is 3, and the last is 1.
# The task
Your program should output the heights of the monoliths in order from left to right. The output format can be in any sort of list or array.
# Notes
* The input can be taken as any dimensional string, list of strings, or list of characters.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so **lowest bytes wins**.
* You are to assume that monoliths always have the same width, and are always at least 1 `_` away from another.
* They can come in any height, and in any quantity.
# I/O
```
  _
 | |        _
 | |  _    | |
 | | | |   | |     _
_| |_| |___| |____| |_   >> [4,2,3,1]
           _
          | |
  _       | |
 | |  _   | |  _
_| |_| |__| |_| |_   >> [2,1,4,1]
 _   _   _ 
| |_| |_| |_____   >> [1,1,1]
____________________   >> undefined behavior
 _
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |   >> [11]
     _       _       _       _       _
 _  | |  _  | |  _  | |  _  | |  _  | |
| |_| |_| |_| |_| |_| |_| |_| |_| |_| |  >> [1,2,1,2,1,2,1,2,1,2]
```
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), (8?) 9 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Ỵ=”|Sḟ0m2
```
A monadic link accepting a list of characters as specified and returning a list of integers.
Note: **8 bytes** if a list of strings, one per line, was really intended to be an allowed input format - just remove the `Ỵ`.
**[Try it online!](https://tio.run/##y0rNyan8///h7i22jxrm1gQ/3DHfINfo////ChAQzwWhaxRqqMNCMRIigGETVB1cbzyyOEQLTGM8F5AVHx8PImE4HkqCKQA "Jelly – Try It Online")**
### How?
```
Ỵ=”|Sḟ0m2 - Link: list of characters, s
Ỵ         - split at newlines
  ”|      - literal '|'
 =        - equals (vectorises)
    S     - sum (vectorises, hence counts the number of '|' in every column)
     ḟ0   - filter out zeros (only keep the results from the sides of the towers)
       m2 - modulo index with 2 (keep only the left side measurements)
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
ỴṚZi€”_ỊÐḟ’
```
[Try it online!](https://tio.run/##y0rNyan8///h7i0Pd86KynzUtOZRw9z4h7u7Dk94uGP@o4aZ////V1CI51KoAUIogPHiQRwgC8KFKIApi@eKBzLBOB5KgikA "Jelly – Try It Online")
[Answer]
# JavaScript (ES6), ~~79~~ 78 bytes
*-1 byte thanks to @Shaggy*
```
a=>a.map((b,i)=>b.replace(/_/g,(_,j)=>o[j]=a.length-i-1),o=[])&&o.filter(x=>x)
```
Takes input as an array of strings.
## Test Snippet
```
f=
a=>a.map((b,i)=>b.replace(/_/g,(_,j)=>o[j]=a.length-i-1),o=[])&&o.filter(x=>x)
I.value="           _\n          | |\n  _       | |\n | |  _   | |  _\n_| |_| |__| |_| |_"
```
```
<textarea id=I rows=7 cols=30></textarea><br><button onclick="O.value=`[${f(I.value.split`\n`).join`, `}]`">Run</button> <input id=O disabled>
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 11 bytes
```
|Rζ'_δkJ®0‚K
```
[Try it online!](https://tio.run/##MzBNTDJM/f@/JkjP6fAO9fhzW7K9Dq0zeNQwy/v/fwWFeC6FGiCEAhgvHsQBsiBciAKYsniueCATjOOhJJgCAA "05AB1E – Try It Online")
`ζ` has been replaced by `.Bø` on TIO since it hasn't been pulled there yet.
[Answer]
# Dyalog APL, 29 bytes
```
{0~⍨↑+/(⌈/⍴¨⍵)↑¨(⍳≢⍵)×⌽⍵='_'}
```
Run with `⎕IO←0`.
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/04BktUHdo94Vj9omautrPOrp0H/Uu@XQike9WzWBQodWaDzq3fyocxGIf3j6o569QIaterx67f//2UC96goK8eoK6go1QAgFCH48iAtkwQQgimBKQerigRwwjoeSYEqd61HvqmyuNIVsLqgdCiiGwwHUbIhFqHaBxSAMFHtgDIQdAA)
**How?**
`⌽⍵='_'` - where `⍵` is `'_'`, top lines first
`×`- multiply by ...
`(⍳≢⍵)` - the range of `⍵` (zero indexed)
`↑¨` - for each line, pad with zeros by ...
`(⌈/⍴¨⍵)` - the maximal length
`↑+/` - sum the rows zipped and flatten
`0~⍨` - removes zeros
[Answer]
# C++, ~~171~~ 169 bytes
```
#import<vector>
#import<iostream>
int f(std::vector<std::string>s){for(int a,j,i=0,k=s.size()-1;a=s[k][i];++i)if(a==32){for(j=0;(a=s[k-++j][i])-95;);std::cout<<j<<" ";}}
```
[Try it online!](https://tio.run/##pVDbboMwDH3nK6zsJREwdZv2sCbhR7oKIQZVqLiIpH0Y49tZLqQrlVpprSPHdnLic@K86@Jdnk/Tk6i7tlfsWOSq7ZPA16KVqi@yOglEo6DEUn2t1w7EbK6vRbNLJBnKtscGlEVVJPgq2nP5LMV3gUn8QjMuN/vtRmxpGAoiSpxx/vbqHlV8RbEFxGFYGRCJP94poZYgbw@KsYoxBIiO42Qo6kw0mARDANquSQJVSAUcBgSQogjBj16z/dWpKXXmDxzIQw0u1YX1dN5tQCO17CU2NGdagTFAnw1y12caYEF@spnbCVlqsWcuWejwyb81mH7OdT/fZf7UHd1ck4f2e6boJ3U1mvmlcBrhjXgxhht@qTQYp18)
# C++ (GCC), 150 bytes
*Thanks to @aschepler!*
```
#import<vector>
#import<iostream>
int f(auto s){for(int a,j,i=0,k=s.size()-1;a=s[k][i];++i)if(a==32){for(j=0;(a=s[k-++j][i])-95;);std::cout<<j<<" ";}}
```
[Try it online!](https://tio.run/##pVDLboMwELzzFSv3Yguo0lY9NLb5kTRCiEJkIjDCTg@lfDv1A6dJpEZqsmi9D493hyn7Pt2V5Tw/iLaXg2afVanlkEWhFlLpoSraLBKdhhoXBy1BkbGWA7adImkSwVfJnqtHJb4qTNInWnC12W83YkvjWBBhXnH@8uwfNXxFsQOkcdxYEEnfXimhSn@s16U8aMYaxhAgOk2zXdEWosMkGiMw5lCeJHO5oSe6XQa6Uho4jAggRwmCb/Mt9lvntjRZaHhQgFpcbgrn@XK6gCbqttfYrjnhCowBeu@Qvz7hAGfLj7bs9kTOubieT854hOTfHOw872ZemLL81A3T/JC7zltUDEr9Ga1@ORwlvBIvZLjil0yjaf4B)
[Answer]
# [Python 2](https://docs.python.org/2/), 75 bytes
```
lambda s:[x.index('_')for x in map(None,*s.split('\n')[::-1])if'_'in x[1:]]
```
[Try it online!](https://tio.run/##bZDBDoIwDIbve4rGyzaDRDwukUfwBYAsGCAukUFcDxjl2bFsoBzs0q3t/n5L1z/x1tnThLVDB2fIOOcAmsGb1mJrpueEopAGwSrTTFPoXS@7PwgXMeahsOF9zeMCeQv3lRBswGvwg86y4Gy9XB7/ifQfo3LBWEMD59O9bK9VCU5lQ2xsVQ@Cay6b7gEDGAtt2YtLZ@to72LX3w0KnlsuM6UOSSFNQ2JSDVmiimKau3Du8v@p/KD9w1iE3es4AqQpvJIxt7uYlG2JAiNoBEo5fQA "Python 2 – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 11 bytes
```
z ·mb'_ fw0
```
[Test it online!](http://ethproductions.github.io/japt/?v=1.4.5&code=eiC3bWInXyBmdzA=&input=IiAgXwogfCB8ICAgICAgICBfCiB8IHwgIF8gICAgfCB8CiB8IHwgfCB8ICAgfCB8ICAgICBfCl98IHxffCB8X19ffCB8X19fX3wgfF8i)
### Explanation
```
z ·mb'_ fw0   : Implicit input
z             : Rotate the input clockwise. This puts the "floor" against the left side.
  ·           : Split the 2D string into lines.
   m          : Replace each column (now row) X with
    b'_       :   the index of '_' in X (0-indexed). This gives us the output list, with
              :   0's and -1's mixed in representing the columns that are not monoliths.
        f     : Take only the items X where
         w0   :   max(X, 0) is truthy. Since 0 is falsy, this removes anything <= 0.
              : Implicit: output result of last expression
```
[Answer]
## PowerShell, 133 bytes
```
param($s)$r=,0*($l=($s=$s-replace'\| \|',' 1 ')[0].Length);1..$s.Count|%{$z=$_-1;0..($l-1)|%{$r[$_]+=(''+$s[$z][$_]-as[int])}};$r-ne0
```
Looks like it's not very competitive; it does a regex replace to turn the towers into columns of 1, makes an array of 0 the length of the input string, then steps through the lines adding up the 1s.
Tests ready to run:
```
$s1 = @'
  _                   
 | |        _         
 | |  _    | |        
 | | | |   | |     _  
_| |_| |___| |____| |_
'@-split"`r?`n"
$s2 = @'
 _
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | 
'@-split"`r?`n"
$s3 = @'
           _      
          | |       
  _       | |           
 | |  _   | |  _   
_| |_| |__| |_| |_ 
'@-split"`r?`n"
$s4 = @'
 _   _   _      
| |_| |_| |_____ 
'@-split"`r?`n"
$s5 = @'
     _       _       _       _       _ 
 _  | |  _  | |  _  | |  _  | |  _  | |
| |_| |_| |_| |_| |_| |_| |_| |_| |_| | 
'@-split"`r?`n"
```
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~48~~ 38 bytes
```
^
¶
{`(¶.*)*¶_(.*¶)+
$#2 $&
}`¶.
¶
G`.
```
[Try it online!](https://tio.run/##K0otycxL/P8/juvQNq7qBI1D2/S0NLUObYvX0AOSmtpcKspGCipqXLUJQBmQGvcEvf//FeK5ahRqFKAAyokHsYEsMA8iDVMEVhEPwvFQEkwBAA "Retina – Try It Online") Link includes first example. Explanation: A line is prefixed which will collect the results. As each column is repeatedly deleted in turn, those that contains a `_` above ground level have the the number of remaining lines in the column counted. Finally the now blank lines are deleted. Edit: Saved 10 bytes thanks to inspriation from @FryAmTheEggman.
[Answer]
# Java 8 - ~~229 Bytes~~ 213 Bytes
```
s->{Map<Integer,Integer> m=new TreeMap();String[] l=s.split("\n");for(int i=0,j=-1;i<l.length-1;++i){s=l[i];while((j=s.indexOf("_",j+1))>=0){m.put(j,i);}}for(int i:m.values()){System.out.print(l.length-i-1+",");}}
```
[Try it online!](https://tio.run/##tVFNU4MwEL3zK3Y4JUIz7VVK7x6qh3qrHSbStA2GwJDQ6iC/HZdPtZ56MLBk92Xz8l5I@JnPslzoZP/WyDTPCgsJYqy0UrG7wHFixY2BNZe6cgCktqI48FjAI7Q1wDmTe4jJxhZSH4HTANEaA19juZUxdmoIoTGzVbXm@fIBKY6i8Id5BWmoxQWeCyFwmdCgp9ruQIWGmVxJS9wX7dLgkBUEBYAM534SzhaBXCqmhD7aExaeJ2llQrWVu@BykkoQkiCB1Hvx/nQgbuT6ibegdBXOaZWyvLQk8SUN6nrivU/ZmatSGEJptfkwVqQsKy3LUZAl01lytvBc3223NmgXneblq0Kng@HuSlK8MTJZ4cXR0MrpbgxAs5g4LkCEtjxMPvEZxi8oahHMfmB967hh6I6w7iIavt3kOvgz@hOvvShNprVRDFxLmMa3gl7RH1Ed3CfXgsbkNjEtXx8938gyuLuVbSL5vwRGSbXj1M0X "Java (OpenJDK 8) – Try It Online")
**Ungolfed:**
```
public static void foo(String input)
{
    Map<Integer, Integer> map = new TreeMap(); // Raw types!!
    String[] lines = input.split("\n");
    for (int i = 0, j = -1; i < lines.length - 1; ++i)
    {
        input = lines[i];
        while ((j = input.indexOf("_", j + 1)) >= 0)
        {
            map.put(j, i);
        }
    }
    for(int i:map.values())
    {
        System.out.print(lines.length - i - 1 + ",");
    }
}
```
Woo, first post. Any help improving it would be great. ~~I *know* I can get rid of that `indexOf` written twice.~~ Knew it! I toyed with the idea of changing the types in the map from Integer to Long but I think that's a dead end.
---
I know there is [a much, much better Java 8 solution already](https://codegolf.stackexchange.com/a/129130/61976), but that takes `char[][]` as input which I think is easier to work with in this case than String.
[Answer]
# Java 8, ~~133~~ ~~117~~ ~~116~~ 114 bytes
```
a->{for(int l=a.length-1,i=0,j;i<a[0].length;i++)if(a[l][i]<33){for(j=0;a[j][i]<33;j++);System.out.print(l-j+",");}}
```
Takes the input as a ~~`String[]`~~ `char[][]` (← saves 16 bytes).  
-2 bytes in exchange for less readable output thanks to *@OlivierGrégoire* by changing `print(l-j+",")` to `println(l-j)`.
**Explanation:**
[Try it here.](https://tio.run/##7VXBcoIwEL33K3a8CCMwdjxG@gf14pFhMimiJo3BgWing/l2mmJ6qQipCqdm2GGyeXm7mzwWRo7Ez/apYKv3KuGkKOCVUFE@AVAh03xNkhQW31OAY0ZXkDjJluRRHMVAXKT9Spt@CkkkTWABAkKoiP9SrrPc0RzAQxLwVGzk1n/2aDj1GKJzEk1j40V0MnHp2iERjyMaz2czt97LwikiETM@xDQKLT8Lme6C7CCDfa7JuXC4z1ykVIXOeewPb1znYdKpU97pgpyl1PhNnfW5GhEkjkg/4KecshzD2KsNm/djTHl1vItxjncyuJMFF@4pXhOvfV5/i3eNtysetoiHf/E0zXGH/3JNqVrnAA3iG/nXxshsapEZ3HXl7cduY@1H3s2Pe@S3kWk75n6ZtGN6kQXuuP5b5NBVatuX0EOZuDHMrdbjLdic6D9mIMwQPRjf@ft9zHp7X8TW/W/I9cc1n@HmRlLqSVVf)
```
a->{                         // Method with character 2D-array parameter and no return-type
  for(int l=a.length-1,      //  Length of the 2D char-array - 1
      i=0,j;                 //  Index-integers
    i<a[0].length;i++)       //  Loop (1) over the 2D char-array
    if(a[l][i]<33){          //   If the base of the current column is a space
      for(j=0;a[j][i]<33;    //    Loop (2) over the cells in this column as long as
                             //    we encounter spaces (from top to bottom)
        j++                  //     And increase `j` every time, to go down the column
      );                     //    End of loop (2)
      System.out.println(l-j);
                             //    Print the amount of rows - `j`
    }                        //   End of if-block
                             //  End of loop (1) (implicit / single-line body)
}                            // End of method
```
[Answer]
# Haskell, ~~75~~ 74 bytes
```
import Data.List;f=filter(>0).map(length.fst.span(<'!').reverse).transpose
```
The input is expected as a list of strings (rowwise).
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 14 bytes
```
0~⍨⍳∘≢+.×'_'=⊖
```
with `⎕IO←0`
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob6qn/6O2CQb/00Bk3aPeFY96Nz/qmPGoc5G23uHp6vHqto@6poHUAeXTFID0/0dtE9UVFOIVMIE6ENYAIRTEY0qAhZCUwCQgQjCJeLBEPJALxvFQEkypAwA "APL (Dyalog Classic) – Try It Online")
---
This function train equivalent to `{((⍳≢⍵)+.×('_'=⊖⍵))~0}`
[Answer]
# [MATL](https://github.com/lmendo/MATL), 12 bytes
```
&nxG2\&fx-Xz
```
Input is a char matrix, with `;` as row separator.
[Try it online!](https://tio.run/##y00syfn/Xy2vwt0oRi2tQjei6v//aHWFeAUsQN1aQV2hBgihIB6LDFgMSQ1cBiIGk4mHyMQD@WAcDyXBlHosAA "MATL – Try It Online") Or [verify all test cases](https://tio.run/##y00syfmfEOH1Xy2vwssoRi2tQjei6r@6rq6ueoRLyP9odYV4BSxA3VpBXaEGCKEgHosMWAxJDVwGIgaTiYfIxAP5YBwPJcGUeiwX0AkIEI9sFhzALYEIx2MVhrsJzkC1FsZQgNgZD7UtHmEETAXUfVDHxasrWIOkoCoopeAejkfzMiYN9lY8wkN4aHTn48HqsQA).
[Answer]
# C#, ~~150~~ ~~144~~ 137 bytes
```
using System.Linq;a=>a.SelectMany((i,h)=>i.Select((c,w)=>new{c,w,d=a.Length-1-h}).Where(o=>o.c==95&o.d>0)).OrderBy(o=>o.w).Select(o=>o.d)
```
Full/Formatted version:
```
using System;
using System.Collections.Generic;
using System.Linq;
class P
{
    static void Main()
    {
        Func<char[][], IEnumerable<int>> f = a =>
            a.SelectMany((i, h) => i.Select((c, w) => new { c, w, d = a.Length - 1 - h })
                                    .Where(o => o.c == 95 & o.d > 0))
             .OrderBy(o => o.w)
             .Select(o => o.d);
        Console.WriteLine(string.Concat(f(new char[][]
        {
            "  _                 ".ToArray(),
            " | |       _        ".ToArray(),
            " | |  _   | |       ".ToArray(),
            " | | | |  | |    _  ".ToArray(),
            "_| |_| |__| |___| |_".ToArray(),
        })));
        Console.ReadLine();
    }
}
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 10 bytes
```
ooYssqtO>)
```
Input is a padded character matrix.
[Try it online!](https://tio.run/##y00syfn/Pz8/sri4sMTfTvP//2h1hXgFLEDdWkFdoQYIoSAeiwxYDEkNXAYiBpOJh8jEA/lgHA8lwZR6LAA "MATL – Try It Online")
[Answer]
# Mathematica, 48 47 39 bytes
```
Last/@(Reverse@Most@#~Position~"_")&
```
[Try it online!](https://tio.run/##ZVDLCsIwELznK0IEURCKepRCxKtCUW@1hKCtDWhTkkUQxF@veUppEzY7O@zshH1yqMVVd12V7rmGhM7Oije6lbqkx/JVKpMPUgOdfDOpBQjZfAkj8@kGIZC7mqutUvydZvx2FPcackvxKxhhQk@gRHM/tQ8B@WRBLg0pCicsNSzTnjwnCGOG8MfccGLFbGGQL31DbGOIGeiChdclUgST1cgE9@b/jxvvnfpmjvGgZxTB32Q9NLEyHyg2h89ZUZeZpQCmuDLhNoHQkFqNqXX3Aw "Mathics – Try It Online")
`Function` which expects a rectangular array of characters. Takes `Most` of the array (all but the last row), `Reverse`s it, then takes the `Transpose`\*, then finds all `Position`s at which the `_` character appears. The relevant heights are the `Last` elements of each `Position`.
\* `` is the `3` byte private use character [`U+F3C7`](https://unicode-table.com/en/search/?q=U%2BF3C7) which represents [`\[Transpose]`](http://reference.wolfram.com/language/ref/character/Transpose.html.en) in Mathematica. Note that this doesn't work in [Mathics](http://mathics.github.io/), so the [TIO link](https://tio.run/##ZVDLCsIwELznK0IEURCKepRCxKtCUW@1hKCtDWhTkkUQxF@veUppEzY7O@zshH1yqMVVd12V7rmGhM7Oije6lbqkx/JVKpMPUgOdfDOpBQjZfAkj8@kGIZC7mqutUvydZvx2FPcackvxKxhhQk@gRHM/tQ8B@WRBLg0pCicsNSzTnjwnCGOG8MfccGLFbGGQL31DbGOIGeiChdclUgST1cgE9@b/jxvvnfpmjvGgZxTB32Q9NLEyHyg2h89ZUZeZpQCmuDLhNoHQkFqNqXX3Aw "Mathics – Try It Online") just uses `Transpose`.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 82 bytes
Takes in a list of lines.
```
->l{l.map! &:chars;(l.pop.zip(*l).map{|s|s.join.count ?|}-[i=0]).select{0<1&i+=1}}
```
[Try it online!](https://tio.run/##TYlBDoIwEEX3nKImhoCGCWyV6kGQNFhLLBnbhsJCac9eURJxkj//vZl@vD5DSy8hO@GE8GjMhsQHfm96e0wQjDbwkibZYfr5Tc46C52WCrge1UDOzmeVpHmdghUo@DDlZRHLPS28D4a01baEXjQ3QKmErQNZh0UrO@JmY/82r@WyQMTm/uYHbw "Ruby – Try It Online")
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGL), 9 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
I{ _WH╥?O
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=SSU3QiUyMF9XSCV1MjU2NSUzRk8_)  
Takes input as an array of arrays of strings (characters).
Explanation:
```
I          rotate the array clockwise
 {         for each element
   _       push "_"
    W      get its index in the array (0 if not found, 1 if its the ground, >1 if its what we need)
     H     decrease that
      ╥    palindromize (duplicates the number, if it's <0, then errors and pushes 0, if =0, pushes 0, if >0, then pushes the number palindromized (always truthy))
       ?   if that, then
        T  output in a new line the original decreased index
```
[Answer]
## JavaScript (ES6), 108 104 88 bytes
Saved 16 bytes thanks to @JustinMariner
```
i=>i.map((s,h)=>{while(t=r.exec(s))m[t.index]=i.length-h-1},m=[],r=/_/g)&&m.filter(e=>e)
```
Input taken as an array of strings
```
let input = [
'  _',
' | |           _',
' | |  _   _   | |',
' | | | | | |  | |     _',
'_| |_| |_| |__| |____| |_'
]
let anonymousFunction =
i=>i.map((s,h)=>{while(t=r.exec(s))m[t.index]=i.length-h-1},m=[],r=/_/g)&&m.filter(e=>e)
console.log(anonymousFunction(input))
```
[Answer]
## CJam, ~~15~~ 14 bytes
1 byte saved thanks to @BusinessCat
```
{W%z'_f#{0>},}
```
This is a block that takes an array of strings on the stack and outputs an array.
### Explanation:
```
W%    e# Reverse
z     e# Zip
'_f#  e# Get the index of '_' in each element (-1 if not found)
{0>}, e# Filter where positive
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), ~~18~~ 17 bytes
15 bytes of code, +2 for `-rp` flags.
```
_FI_@?'_MRVgZDs
```
Takes input from stdin. [Try it online!](https://tio.run/##K8gs@P8/3s0z3sFePd43KCw9yqX4/38FhXguhRoghAIYLx7EAbIgXIgCmLJ4rnggE4zjoSSY@q9bVAAA "Pip – Try It Online")
### Explanation
```
                 g is list of lines from stdin (-r flag); s is space
         RVg     Reverse g
            ZDs  Zip (transpose), filling gaps with a default char of space
        M        Map this function:
   _@?'_          Index of _ in each line (or nil if it doesn't appear)
_FI              Filter, keeping only the truthy (nonzero, non-nil) values
                 Autoprint in repr format (-p flag)
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~19~~ ~~15~~ 14 bytes
```
f>T0mx_d\_.tQd
```
[Test it online!](https://pyth.herokuapp.com/?code=f%3ET0mx_d%5C_.tQd&input=%5B%22++_%22%2C%22+%7C+%7C++++++++_%22%2C%22+%7C+%7C++_++++%7C+%7C%22%2C%22+%7C+%7C+%7C+%7C+++%7C+%7C+++++_%22%2C%22_%7C+%7C_%7C+%7C___%7C+%7C____%7C+%7C_%22%5D&debug=0) The input is a list of lines.
**Explanations**
```
          .tQd     # Transpose, pad with spaces
    mx_d\_         # For each line, reverse it, find the position of "_" (-1 if not found)
f>T0               # Filter on positions greater than zero
```
[Answer]
# Octave, 31 bytes
```
@(a)(s=sum(a>95))(s>0)(1:2:end)
```
Takes a 2D array of chars as input.
[Verify all test cases!](https://tio.run/##pVLdDoIgFL6Opzh3wF22dZHO1ns0x5ji1kxtod2Yz25Hj@Bsy5tg55ePj49BnTb6ZYbhIrQUNrZtKfT5dJRYnPdSBOEhNFUmhzzWlY1YY2yTamssxNCxK@MAiqN/45zHUquxxMw1COSgI05hMZma/RR4wogaVpx@zJTEvz5i6lGyoncJT8YNjPhHLBliHWLW4ZETkNb/8olnA1ik/4yc9Lk7bcQv7RtGGvoIr5/XTyjwDYMQqrY0d@EfVjK2y272IfKlB13RS8nwIwwf "Octave – Try It Online")
[Answer]
# [Perl 6](http://perl6.org/), 65 bytes
```
{m:ex/^^(\N+)_([\N*\n]+:)/.sort(*[0].chars).map(+*[1].comb("
"))}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/OtcqtUI/Lk4jxk9bM14jOsZPKyYvVttKU1@vOL@oREMr2iBWLzkjsahYUy83sUBDWyvaECiQn5ukocSlpKlZ@99aoTixUiFNozintKgAqDQ/t0DzvwIIxCso4Ke5QMwaICRAcwFxPBEYAA "Perl 6 – Try It Online")
* `m:exhaustive/^^(\N+)_([\N*\n]+:)/` searches the input string for all underscores, and returns a match object for each, where the first capturing parentheses contain the preceding part of the line on which the underscore is found, and the second capturing parentheses contain the entire rest of the string. The rest of the string must contain at least one newline, so we don't count the underscores at ground level. The `:exhaustive` flag allows these matches to overlap.
* `.sort(*[0].chars)` sorts these match objects by the number of characters in the part of the line preceding each underscore. This orders them left-to-right.
* `.map(+*[1].comb("\n"))` maps each match object to the number of newline characters in the part of the input string trailing each underscore--that is, the height. The `\n` is an actual newline character, saving one byte.
[Answer]
# [Python 2](https://docs.python.org/2/), 58 bytes
```
lambda l:[s.index('_')+1for s in zip(*l[-2::-1])if'_'in s]
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSHHKrpYLzMvJbVCQz1eXVPbMC2/SKFYITNPoSqzQEMrJ1rXyMpK1zBWMzMNKA8ULo79X1CUmVeikabBFa2ugADxEEpdh0sBSbgGCJGE47EKg3nxMOF4qHA8kAfGcIZ6LJem5n8A "Python 2 – Try It Online")
Taking input as list of strings.
[Answer]
# PHP, 119 bytes
```
function($s){$r=array_map(null,...$s);foreach($r as$k=>&$v)if($v=array_count_values($v)['|'])echo($v+$r[$k+2]=0)." ";};
```
Let's break this down! Our input here is a 2D array of chars.
```
$r=array_map(null,...$s) // Neat little snippet to transpose the array
foreach($r as$k=>&$v)    // Loop through the array, grabbing each row of our 2D array 
(which is now each column of the monolith)
if($v=array_count_values($v)['|']) // Count the number of '|' characters in the column 
(which is the height of our monolith), and if it's greater than 0 (truthy in PHP)...
echo($v+$r[$k+2]=0)." "; // Output that number, and simultaneously set the row 2 indices
                            down to null (to remove duplicate values)
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Takes input as an array of lines.
```
Õ®x2 èSÃf
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=tw&code=1a54MiDoU8Nm&input=IiAgXwogfCB8ICAgICAgICBfCiB8IHwgIF8gICAgfCB8CiB8IHwgfCB8ICAgfCB8ICAgICBfCl98IHxffCB8X19ffCB8X19fX3wgfF8i) (header splits input string to array) or [run all test cases](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&header=tw&code=1a54MiDoU8Nm&input=WwoiICBfCiB8IHwgICAgICAgIF8KIHwgfCAgXyAgICB8IHwKIHwgfCB8IHwgICB8IHwgICAgIF8KX3wgfF98IHxfX198IHxfX19ffCB8XyIKCiIgICAgICAgICAgIF8KICAgICAgICAgIHwgfAogIF8gICAgICAgfCB8CiB8IHwgIF8gICB8IHwgIF8KX3wgfF98IHxfX3wgfF98IHxfIgoKCiIgXyAgIF8gICBfIAp8IHxffCB8X3wgfF9fX19fIgoKIl9fX19fX19fX19fX19fX19fX19fIgoKIiBfCnwgfAp8IHwKfCB8CnwgfAp8IHwKfCB8CnwgfAp8IHwKfCB8CnwgfAp8IHwiCgoiICAgICBfICAgICAgIF8gICAgICAgXyAgICAgICBfICAgICAgIF8KIF8gIHwgfCAgXyAgfCB8ICBfICB8IHwgIF8gIHwgfCAgXyAgfCB8CnwgfF98IHxffCB8X3wgfF98IHxffCB8X3wgfF98IHxffCB8X3wgfCAiCl0tbVI)
```
Õ®x2 èSÃf     :Implicit input of array
Õ             :Transpose
 ®            :Map
  x2          :  Trim left
     è        :  Count
      S       :    Spaces
       Ã      :End map
        f     :Filter
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
ṖZ=”_UT€F
```
[Try it online!](https://tio.run/##y0rNyan8///hzmlRto8a5saHhjxqWuP2/@HuLYfbNf//j@ZSUlJSUIjnUqgBQiiA8eJBHCALwoUogCmL54oHMsE4HkqCKaBxOhAzFZCMgwOwaRCDkc0Gi0AYSObCGHAzQaogmAsmB7Ua1V6Y@ThpLhATZjEeGsUaPBhoMVcsAA "Jelly – Try It Online")
Unfortunately, [Jonathan Allan's answer](https://codegolf.stackexchange.com/a/129112/66833) is still shorter, as I assume input is a list of lines, so don't count the `Ỵ`. However, I reckon this is an interesting enough approach to post
## How it works
```
ṖZ=”_UT€F - Main link. Takes a list of lines L on the left
Ṗ         - Remove the last line
 Z        - Transpose
  =”_     - Check each character for equality with "_"
     U    - Reverse each row
       €  - For each row
      T   - Yield the indices of 1
        F - Flatten
```
]