g | x | w | all
Bytes Lang Time Link
271Bespoke250814T070332ZJosiah W
095brainfuck250306T121912Z鳴神裁四点一号
011Uiua241019T223519Znyxbird
018APL241018T121159ZVen
094Rockstar230622T103602ZShaggy
052Erlang230621T203418Zdon_aman
029sed 4.2.2230621T204004ZYelp
010Thunno 2 N230621T172036ZThe Thon
035Zsh builtins only190907T133756Zroblogic
084GFortran211112T053726Zroblogic
039Pure Bash221119T231526Z鳴神裁四点一号
nanAWK220909T083704Z鳴神裁四点一号
028K ngn/k221108T141933Zoeuf
023APL221108T003540ZSebastia
012Pyth221108T071145Zhakr14
019Knight v2221108T061942ZEasyasPi
277Scratch221108T025252Zbadatgol
068C++ gcc221107T184920Zc--
122Pascal221107T202752ZKai Burg
nanPure Bash211111T125209Zuser1004
116CLCINTERCAL210911T040746Zuser1004
nansed210319T110947Zuser1004
007Stax210407T105229ZRazetime
nanPxem210319T122923Zuser1004
040Excel210319T122609ZAxuary
026Dash210319T105759Zuser1004
062Python 3190907T033932ZSagittar
009Husk201127T052002ZRazetime
014Vim170825T143657ZVivian
015Pyth171221T224532ZTornado5
050SNOBOL4 CSNOBOL4171213T173518ZGiuseppe
045R170824T074222ZSven Hoh
022Implicit170922T164924ZMD XF
089C#170824T034643Zsnorepio
024Jq 1.5170922T173622Zjq170727
053><>170828T011253ZSasha
013CJam170912T062554ZEsolangi
037Javascript170830T161927ZTHC
050PHP170828T015550ZTitus
139TeX170827T200834ZA Gold M
046C170824T142308Zsimon
048JavaScript ES6170827T111933Zsgtdck
009Jelly170824T024556Zfireflam
010Japt170824T063621ZShaggy
046C gcc170824T153547ZFelix Pa
020J170826T052251ZGregory
053Java 8170824T132226ZKevin Cr
112C++ GCC170824T103550ZSteadybo
034JavaScript170824T020844Zuser7234
015Retina170824T022413Zuser7234
025Haskell170824T153021Zjferard
040Java 8170824T160545ZJakob
nanGNU Sed170824T183413ZDaniel S
nanParadoc v0.2.8+170824T190120Zbetavero
009Pyth170824T085133ZMr. Xcod
nanCOBOL GnuCOBOL170824T060010ZJakob
009Pyke170824T135111ZBlue
016Perl 5170824T034229ZXcali
010V170824T020610Znmjcman1
01105AB1E170824T095718ZErik the
nanRuby170824T021517ZPavel
032PowerShell170824T062605ZTessella
023Octave170824T035809Zrahnema1
009Gaia170824T030454ZBusiness
037Python 2170824T021146Ztotallyh
013Actually170824T024833Zuser4594

Bespoke, 271 bytes

comment-cutting lines of COBOL?am I so early,no coder in C or BASIC is there?if I am,screw it
we read by line,ignoring six leading letters;seven is kept
now,if forty-two is read in,discount extra letters in it;else,output it totally
the end is a convenient exponent error

This program takes the form of an infinite loop, in which the following is done:

The input is assumed to end with a newline; otherwise, this will print Unicode codepoint 1,114,111 forever.

brainfuck, 95 bytes

--[>+<++++++]>-[>>,,,,,,,[<<[->>->+<<<]+[<,[->>+<<]>>>[<.<[-]]<[<[-]<]>>[-<+>]<----------]]>>>]

Try it online!

The last line of the input must have a trailing newline.

With comments, 994 bytes

generate 42 on cell 0
--[>+<++++++]>-

main loop
[

cell 2 stores seventh column
>>

read first to sixth columns
,,,,,,

read seventh column
,

reject eof
[
  consume cell 0 value 42
  subtract 42 from cell 2
  preserve 42 to cell 3
  <<
  [->>->+<<<]

  cell 0 stores eighth through newline columns
  +[
    read next column to store to cell 1
    cell _1 as temporary
    <,
    [->>+<<]
    >

 cell 0       1     2         3
      garbage VALUE 0/_10     42
      ^

    output cell 1 and consume if cell 2 is minus ten
    >>[<.<[-]]

    memory layout and ptr
 cell 0       1     2         3
      garbage VALUE 0         42
                    ^
    or
 cell 0       1     2         3
      0       VALUE _10       42
      ^

    reset cell 0 and move to _1
    <[<[-]<]

    now move cell 1 value to cell 0
    >>[-<+>]<

    exit loop if cell 0 is value 10
    ----------
  ]
]

move to cell 3
>>>

redo the things in this loop
reindex cell 3 as cell 0
]

INPUT NEEDS TRAILING NEWLINE

Try it online!

Uiua, 11 bytes

▽≠□@*⍚°⊂⍚↘₆

Try it!

▽≠□@*⍚°⊂⍚↘₆
         ⍚↘₆ # drop the first 6 characters from each row
     ⍚°⊂     # split each row into head and tail
 ≠□@*         # check which heads aren't equal to a boxed '*'
▽             # keep the tails whose heads aren't equal

# Experimental! because of the subscript on ↘ drop.

APL, 18 bytes:

{8↑¨⍵/⍨' '=⍵⌷⍨¨⊂7}

Explanation:

{8↑¨⍵/⍨' '=⍵⌷⍨¨⊂7}
{           ⍵⌷⍨¨⊂7} ⍝ Each 7th character of every line
{       ' '=       } ⍝ is a space?
{   ⍵/⍨           } ⍝ if so, keep
{8↑¨               } ⍝ then remove the first 8 characters

Rockstar, 94 bytes

listen to S
while S
cut S in N
cut S
while N-S-7
roll S in C

if C-1
join S
say S

listen to S

Try it (Code will need to be pasted in)

Erlang, 52 bytes

a(A)->[lists:nthtail(7,X)||X<-A,lists:nth(7,X)/=42].

Try it online!

sed 4.2.2, 29 bytes

/^.{6}\*.*$/d
s/^.{7}//
/^$/d

Try it online!

Thunno 2 N, 10 bytes

¤æ6ið=;ı7ỵ

Attempt This Online!

Explanation

¤æ6ið=;ı7ỵ  # Implicit input
¤           # Split the multi-line input on newlines
 æ    ;     # Filter this list of strings by:
  6i        #  The 6th character (0-indexed)
    ð=      #  Is a space
       ı    # Map over this new list of strings:
        7ỵ  #  Remove the first 7 characters
            # Implicit output, joined on newlines

Zsh (builtins only), 35 bytes

for l ("${(f)$(<p)}")<<<${l:7$l[7]}

Try it Online

Scans file p per this tip. Other solutions: 45 bytes, 27b (illegal)

GFortran, 84 bytes

Try it Online!

Yet again, Fortran beats Cobol ☺. Borrows stuff from this solution.

character(99)C;read*,n;do i=1,n;read'(A)',C
if(C(7:7)<'*')print'(A)',C(8:);enddo;end

Previously: 95 bytes ; 98 bytes(-47 by removing array) ; 145 bytes

Pure Bash, 39 bytes

Outgolfed user100411's answer

for x
{ ((1${x:6:1}1))||echo "${x:7}"
}

Attempt This Online!

Usage

Each argument represents a line. e.g.

cat<<'EOF'>f
for x
{ ((1${x:6:1}1))||echo "${x:7}"
}
EOF
bash f '000000 blah blah' '000001* apples' '000002 oranges?' '000003* yeah, oranges.' '000*04 love me some oranges'

AWK, 34 24 15 bytes

sub(/^.{6} /,_)

Attempt This Online!

K (ngn/k), 28 bytes

{$["*"=x@6;"";" "/1_" "\x]}'

Try it online!

Takes a list of strings and returns a list of strings.

Explanations:

{$["*"=x@6;"";" "/1_" "\x]}'  Main function. Takes implicit input
                           '  For each string in the lists...
{                         }   Execute a function that
 $[                      ]    Checks if
       x@6                    The character at the 6th position (0-indexed)
   "*"=   ;                   Is equal to an asterisk
           "";                If it does, return an empty string
                        x     Else, return the string
                    " "\      Splitted by whitespace
                  1_          Trim the first element (i.e. the line numbers)
              " "/            Join together by whitespace (to preserve the original text)

APL, 23 bytes

This is my first ever attempt at a code golf challenge, feel free to improve, i'm sure i could have saved one or two characters if i wasn't so adamant on making this code 'tacit'

This assumes the input is a list of lines and return a list of uncommented lines, this makes everything a bit easier since APL was explicitly made to work on list!

(('*'≠7∘⌷)⊢⍤/(8≤⍳8)∘⊂)¨

Go ahead and try it! (Thanks @Sʨɠɠan)

Pyth, 12 bytes

tMfqdhT>R6.z

Try it here.

Explanation:
tMfqdhT>R6.z | Full program
-------------+----------------------------------------
        R .z | For each line of input
       > 6   |  Remove the first 6 characters
  f  hT      | Filter over whether the first character
   qd        |  is a space
tM           | Remove the first character of each

Knight (v2), 19 bytes

W=xP|?42A=xSxF6@O]x

There are a few ways to do this that all are 19 bytes, but the theoretically optimal way (= x SUBST(PROMPT 0 6 @)) suffers from keyword clashing, meaning it has to be =xS P0 6@, wasting two separators.

# for each line in stdin
WHILE (= x PROMPT)
    #  If not equal to to 42 (ASCII("*"))
    #   |    | ASCII value of first char
    #   |    |     | Strip the first 6 chars of x
    : | ? 42 ASCII (= x SUBST (x FALSE 6 @))
      # Output the tail (all but the first char) of x
      : OUTPUT (] x)

This uses the new ] and @ operators to simplify string operations, as ] replaces SxF1"" and @ replaces "" when coerced to String since empty list is empty string.

Input is in stdin, output is in stdout.

Try it online!

Scratch, 277 bytes.

define g[x
set[s v]to(
set[j v]to((x)+(1
repeat(length of(item(i)of[l v
set[s v]to(join(s)(letter(j)of(item(i)of[l v
change[j v]by(1
end
replace item(i)of[l v]with(s
define f
set[i v]to(1
repeat(length of[l v
g(6
if<(s)contains[*]?>then
delete(i)of[l v
else
g[1
change[i v]by(1

Try it on Scratch! enter image description here

C++ (gcc), 68 bytes

[](auto&l){l.remove_if([](auto&s){int c=s[6];s=&s[7];return c&2;});}

Input is a std::list<std::string>, it's modified in place.

Try it online!

Pascal, 122 B

This is a complete program requiring a processor complying to ISO standard 10206 “Extended Pascal”:

program p(input,output);var l:string(80);begin while not EOF do begin readLn(l);if''=l[7]then writeLn(subStr(l,8))end end.

Ungolfed version with some explanatory comments:

program uncommentFixedFormatCobol(input, output);
    var
        { This “discriminates” the built-in schema data type `string`
          to have a capacity of up to 80 characters, i.e. the maximum
          width of one COBOL _fixed-format_ source code line. }
        line: string(80);
    begin
        { `EOF` is shorthand for `EOF(input)`. }
        while not EOF do 
        begin
            { `readLn(line)` is shorthand for `readLn(input, line)`. }
            readLn(line);
            { Similarly, `write(x)` is shorthand for `write(output, x)`. }
            
            { ---- Remember, in Pascal `string` indices are 1-based. ----- }
            { This may look like an empty string check, and `''` is indeed
              an empty string, yet in Pascal the `=`-comparison first pads
              both operands  to the same length using `' '`.  This line is
              in fact doing `if line[7] = ' ' then`, but one byte shorter. }
            if line[7] = '' then
            begin 
                { `subStr(line, 8)` shorthand for
                  `subStr(line, 8, length(line) - 8 + 1)` }
                writeLn(subStr(line, 8))
                { Wait! What if `line[8]` does not exist? The standard
                  says it shall be an error if `firstCharacterIndex +
                  substringLength − 1` is greater than the length of the
                  supplied string. If `length(line)` equals seven, then
                  we’re calling `subStr(line, 8, 0)` which is fine. }
            end
        end
    end.

Pure Bash, 42 + 1 = 43 bytes

Filename must be x; it is for extra one byte.

read x||>x
((1${x:6:1}1))||echo ${x:7}
. x

Try it online!

Usage

CLC-INTERCAL, 116 bytes.

DO;1<-#6DO,1<-#999DOCOMEFROM.1DOWRITEIN;1+,1(91)DO.1<-,1SUB#2(1)DO.2<-.1~#1DDOCOMEFROM.2DO,1SUB#3<-#0(95)DOREADOUT,1

Try it online, although you need to copy and paste!

Assumption

Explaination

DONOTE stores first six characters of line
DO;1<-#6
DONOTE stores rest of characters of line except trailing newline
DO,1<-#999
DONOTE label one
DOCOMEFROM.1
DOWRITEIN;1+,1
DONOTE goto label one if tail one is asterisk
DONOTE first two items of tail one shall be
DONOTE 91 and 95 if space, or
DONOTE 91 and 95 if asterisk
(91)DO.1<-,1SUB#2
DONOTE goto label two if line is not empty
DONOTE obtw every item of tail will be zero
DONOTE if empty line
(1)DO.2<-.1~#1
DONOTE die here
D
DONOTE label two
DOCOMEFROM.2
DONOTE erase the space
DONOTE obtw zeros on tail are ignored
DONOTE when reading out
DONOTE see source code for more info
DO,1SUB#3<-#0
DONOTE goto label 1 after reading out
(95)DOREADOUT,1

sed, 11 bytes + 3 bytes option -nr = 14 bytes.

s/^.{6} //p

Try it online!

sed, 16 bytes

#n
s/^.\{6\} //p

Try it online!

#n on top of line is for -n, which is GNU-extension POSIX-compatible.

Stax, 7 bytes

ê┬|Y¶à6

Run and debug it

Explanation

m6%B42=C
m        map each line:
 6%      split at index 6, push both parts
   B     uncons, pop and push first element
    42=C if equal to 42, cancel

Pxem, 88 bytes (filename) + 0 bytes (content) = 88 bytes, with non-printable characters.

Try it online!

Usage

/path/to/pxem/interpreter THAT_PROGRAM_AS_IN_ABOVE <input.txt

COBOL program to be input must be fed from stdin, with LF-styled newlines, whose last line is terminated with LF.

Alternative: Pxem, 100 bytes (filename) + 0 bytes (content) = 100 bytes, printables and LF only.

Filename is as follows:

ab.-.t.i.m.+.w.i.s.i.s.i.s.i.s.i.s.i*.zAB.z.i.c.o
.a02.-.tXX.a.mac.-.zAB.i
.z.i
.aXX.aab.-.t.i.m.+.a

Commented version

XX.z (this is just to format well
.a<0x01>.tXX.z (reg=1
.a.i.m.+.wXX.z (while getchar()!=EOF; do (obtw EOF is -1
   .a.i.s.i.s.i.s.i.s.i.sXX.z (5.times { getchar(); }
   .a.i*.zXX.z (while getchar()!='*'; do
      .aAB.z.i.c.o<0x0A>.aXX.z (do print(c=getchar()) while c!=newline
      .a<0x02>.tXX.z (reg=2
   .aXX.aXX.z ( break; done
   .a.m<0x02>.zXX.z (while reg!=2; do
      .aAB.i<0x0A>.z.i<0x0A>.aXX.z (do c=getchar() while c!=newline
   .aXX.aXX.z ( break; done
   .a<0x01>.tXX.z (reg=1
.a.i.m.+.aXX.z (done
.a

Excel, 40 bytes

=FILTER(MID(A:A,8,73),MID(A:A,7,1)<>"*")

COBOL has a max line length of 80.

Dash, 26 bytes

cut -c7-|grep ^\ |cut -c2-

Try it online!


Dash, 29 bytes

cut -c7-|grep -vF \*|cut -c2-

Try it online!

OBTW it's POSIX-compatible, if I remember the specs correctly.

Python 3, 62 bytes (no regex)

def f(s):
 for w in s.split('\n'):
  if w[6]!='*':print(t[7:])

It works!

>>> s="""000000 blah blah
000001* apples
000002 oranges?
000003* yeah, oranges.
000*04 love me some oranges"""
>>> f(s)
blah blah
oranges?
love me some oranges

Husk, 9 bytes

fo≠' ←m↓7

Try it online!

same idea as Jelly.

Vim, 14 bytes

Ctrl-VG5ld:%g/\*/dEnter

Loading the input file as the buffer to edit, then enter the above commands. Output is the new buffer.

Pyth - 15

V.z*.DNU7n@N6\*

Explanation:

V.z*.DNU7n@N6\*
V.z              For each line N in input
                  Print
     N             N
   .D U7           but with characters 0-6 removed
  *                times
          @N6       Item six of N
         n          Does not equal
             \*     "*"
      

SNOBOL4 (CSNOBOL4), 72 70 66 50 bytes

R	INPUT POS(6) (' '  REM . OUTPUT | '*') :S(R)
END

Try it online!

Pattern matching in SNOBOL is quite different from regex but the idea here is still the same: If a line matches "six characters and then an asterisk", remove it, otherwise, remove the first seven characters of the line and print the result.

This now actually takes better advantage of SNOBOL's conditional assignment operator.

The pattern is POS(6) (' ' REM . OUTPUT | '*') which is interpreted as:

Starting at position 6, match a space or an asterisk, and if you match a space, assign the rest of the line to OUTPUT.

R, 47 45 bytes

function(x)gsub("(?m)^.{6}( |.*\\n)","",x,,T)

Implicit, 22 bytes

('\6¯_0=`*!{]\1%ß1}]^ö

No explanation, sorry. I forgot how this works.

C#, 160 145 90 89 bytes

t=>{var o="";foreach(var s in i.Split('\n'))if(s[6]!=42)o+=s.Substring(7)+"\n";return o;}

Thanks to Pavel & auhmaan for reducing the size.

Jq 1.5, 24 bytes

select(.[6:]<"*")|.[7:]

Explanation

  select(.[6:] < "*")          # discard if '*' in column 7
| .[7:]                        # keep remaining portion

Sample run with paste to show input vs output

$ paste input <(jq -MRr 'select(.[6:]<"*")|.[7:]' input)
000000 blah blah                blah blah            
000001* apples                  oranges?                    
000002 oranges?                 love me some oranges 
000003* yeah, oranges.          
000*04 love me some oranges

$ wc -c <<<'select(.[6:]<"*")|.[7:]'
      24

Try it online

><>, 57 53 Bytes

>i~i~i~i~i~i~i67*=\
<o$/?:$/?=a:;?(0:i<
\~$/~\ $
/  <o\?/

try it online

Explanation

>i~i~i~i~i~i~i67*=    Read in the first seven bytes of the line
 i~i~i~i~i~i~         Read, and discard 6 characters
             i        Read the seventh
              67*=    Check if the seventh character was an 
                      asterisk (and leave that value on the stack );

<o$/?:$/?=a:;?(0:i<    Read characters until a newline or eof
                 i     Read the next character of the line
            ;?(0:      If it's a -1, terminate the program
       /?=a:           If it's a newline, break out of the loop
   /?:$                If the seventh character was not an asterisk
<o$                    Output this character
\~$/                   otherwise discard it

   /~\ $    Having reached the end of the line, output
/  <o\?/    the newline only if it was not a comment

Edit: 53 bytes

>   i~i~i~i~i~i~i67*=\
/?=a<o/?$@:$@:$;?(0:i<
~   \~/

Basically the same stuff as before, but restructured slightly

As a side note: I'm disappointed no-one's done this in cobol yet.

CJam, 13 bytes

{{6>'*#},7f>}

Try it online!

Explanation:

{           }  e# Block. Input:                ["000000 blah blah" "000001* apples" "000002 oranges?" "000003* yeah, oranges."]
 {     },      e# Filter on the following:
  6>           e#   Remove first 6 characters: [" blah blah" "* apples" " oranges?" "*yeah, oranges"]
    '*#        e#   Find a '*':                [-1 0 -1 0]
               e# End filter:                  ["000000 blah blah" "000002 oranges?"]
         7f>   e# Remove first 7 characters:   ["blah blah" "oranges?"]

Javascript, 37 bytes

Regexp-based solution

s=>s.replace(/^.{6}( |(\*.+$\n?))/gm,'')

PHP, 50 bytes

foreach(file(C)as$s)$s[6]>" "||print substr($s,7);

same length:

foreach(file(C)as$s)$s[6]^a^q||print substr($s,7);
foreach(file(C)as$s)$s[6]^b^x&&print substr($s,7);
foreach(file(C)as$s)echo$s[6]^b^x?substr($s,7):"";

regex solution, 51 bytes:

<?=join(preg_filter("#^.{6} (.*)$#","$1",file(C)));

builtins only, 108 bytes:

<?=join(array_map(function($s){return substr($s,7);},array_filter(file(C),function($s){return$s[6]^b^x;})));

take code from a file named C. Run with -nr or try them online.

TeX - 139 bytes

\let~\def~\a#1#2#3#4#5#6{\b}~\d#1{\catcode`#1=12}\obeylines\d\ ~\b#1#2
{\if#1*\else\write1{#2}\fi\egroup
}\everypar{\bgroup\d\\\d\{\d\}\a}

Eats up the first six characters of each line, then checks if the next one is an asterisk or something else. Recurses over lines by eating up anything that tries to get typeset. The rest of my bytes are spent on changing category codes of syntax related characters so it's robust.

C, 63 59 55 48 47 46 bytes

Thanks to "an anonymous user" for getting rid off yet another byte.

Thanks to Felix Palmen for reminding me of "You may assume the seventh character is always an asterisk or a space.", which shaved off one more byte.

f(char**a){for(;*a;++a)(*a)[6]&2||puts(*a+7);}

Use like:

char** program = { "000000 apple", "000001 banana", "celery donuts", 0 };
f(program);

Try it online!

JavaScript (ES6), 48 bytes

s=>s.map(c=>c[6]<"*"?console.log(c.substr(7)):1)

Try it online!

Jelly, 11 9 bytes

ṫ€7Ḣ⁼¥Ðf⁶

Try it online!

Inputs and outputs as a list of lines.

-2 bytes thanks to @EriktheOutgolfer and @JonathanAllan

How it works

ṫ€7Ḣ=¥Ðf⁶
 €           On each line:
ṫ 7            Replace the line with line[7:]
      Ðf     Keep all lines that meet condition:
     ¥         Dyad:
   Ḣ             First Element (modifies line)
    =            Equals
        ⁶    Space

Japt, 11 10 bytes

Takes input as an array of strings and outputs an array of strings.

k_g6 x
®t7

Test it (-R flag for visualisation purposes only)


Explanation

Implicit input of array U.

f_

Filter (f) by passing each element through a function.

g6

Get the character at index (g) 6 (0-indexed).

x

Trim, giving either * (truthy) or an empty string (falsey).

®t7

Map (®) over the array and get the substring (t) of each element from the 7th character. Implicitly output the resulting array.

C (gcc), 53 48 46 bytes

x;main(y){for(y=&x;gets(y-6);x&2||puts(y+1));}

Try it online!

-5 bytes: It was very tricky to get this "whole program" down to the same size as gurka's function. It's now writing out of bounds (in both directions) of an array of wrong type and relies on little endian and 4 byte integers to find the asterisk ... but hey, it works ;)

-2 bytes: Well, if we already write to some "random" .bss location, why bother declaring an array at all! So here comes the string handling program that uses neither the char type nor an array.

J, 20 bytes

7&}."1(#~'*'~:6&{"1)

This assumes the input is a matrix of equal-length space-padded lines.

Java 8, 95 54 53 bytes

s->s.filter(x->x.charAt(6)<33).map(x->x.substring(7))

-42 bytes thanks to @OliverGrégoire, by using a Stream<String> instead of String as in- and output.

Explanation:

Try it here.

s->                          // Method with Stream<String> as parameter and return-type
  s.filter(x->x.charAt(6)<33)//  Filter out all lines containing an asterisk as 7th char
   .map(x->x.substring(7))   //  And remove the first 7 characters from the remaining lines
                             // End of method (implicit / single-line body)

C++ (GCC), 121 112 bytes

Thanks to @gurka for saving 9 bytes!

#import<bits/stdc++.h>
void f(std::list<std::string>l){for(auto s:l)if(s[6]-42)std::cout<<s.substr(7,s.size());}

Takes input as a list of lines.

Try it online!

JavaScript, 44 34 bytes

Crossed-out 44 is still regular 44.

6 bytes saved thanks to tsh

a=>a.replace(/^.{6}( |.*\n)/gm,'')

Try it online!

Retina, 23 15 bytes

5 bytes saved thanks to nmjcman101
1 byte saved thanks to Neil

m`^.{6}( |.*¶)

Try it online!

Haskell, 27 25 bytes

Laikoni's version is shorter than mine:

f n=[x|' ':x<-drop 6<$>n]

Try it online!

My version:

f n=[drop 7x|x<-n,x!!6<'*']

Try it online!

Java 8, 40 bytes

Regular expressions: just about, but not quite, the wrong tool for the job. Lambda from String to String (assign to Function<String, String>). Input must have a trailing newline.

s->s.replaceAll("(?m)^.{6}( |.*\\n)","")

Try It Online

Acknowledgments

GNU Sed, 19 + 2 = 21 characters

Requires -E argument to sed to enable extended regular expressions.

/^.{6}\*/d;s/^.{7}/

Paradoc (v0.2.8+), 8 bytes (CP-1252)

µ6>(7#;x

Takes a list of lines, and results in a list of uncommented lines.

Explanation:

μ        .. Map the following block over each line (the block is terminated
         .. by }, but that doesn't exist, so it's until EOF)
 6>      .. Slice everything after the first six characters
   (     .. Uncons, so now the stack has the 6th character on top
         .. and the rest of the line second
    7#   .. Count the multiplicity of factors of 7 in the character
         .. (treated as an integer, so '*' is 42 and ' ' is 32)
      ;  .. Pop the top element of the stack (the rest of the line)...
       x .. ...that many times (so, don't pop if the 6th character was a
         .. space, and do pop if it was an asterisk)

Hi, I wrote a golfing programming language. :)

I'm still developing this and added/tweaked a bunch of built-ins after trying to write this so that there are more reasonable ways to differentiate between a space and an asterisk than "7#", but I feel like that would make this noncompeting. It's fortunate that it still worked out (this only uses features from v0.2.8, which I committed three days ago).

Pyth, 9 bytes

Note that this only works if at least 1 line is not a comment and at least 1 line is a comment. All the other solutions work in all cases.

-2 bytes thanks to @pizzakingme!

m>d7.m@b6

Try it here!

Explanation

m>d7.m@b6     - Full program with implicit input. Takes input as a list of Strings.

m>d7          - All but the first 7 letters of 
    .m   (Q)  - The input, filtered for its minimal value using the < operator on
      @b6     - the 7th character -- note that "*" is greater than " "
              - Implicitly Output the result.

Pyth, 11 bytes

tMfqhTdm>d6

Try it here!

Explanation

tMfqhTdm>d6 - Full Program with implicit input. Takes input as a list of Strings.

       m>d6 - Remove the first 6 characters of each line.
    hT      - Get the first character of each.
  fq  d     - Keep those that have the first character an asterisk.
tM          - Remove the first character of each.
            - Output Implicitly.

Pyth, 11 bytes

m>d7fqd@T6Q

Try it here!

Explanation

m>d7fq@T6dQ  - Full program. Takes input as a list of Strings.

      @T6    - The sixth character of each.
    fq   dQ  - Keep the lines that have a space as ^.
m>d7         - Crop the first 7 characters.
             - Output implicitly.

Pyth, 12 bytes

tMfnhT\*m>d6

Try it here!

Explanation

tMfnhT\*m>d6 - Full Program with implicit input. Takes input as a list of Strings.

        m>d6 - Remove the first 6 characters of each line.
    hT       - Get the first character of each.
  fn  \*     - Filter those that aren't equal to an asterisk.
tM           - Remove the first character of each.
             - Output Implicitly.

Pyth, 12 bytes

m>d7fn@T6\*Q

Try it here!

Explanation

m>d7fn@T6\*Q  - Full program. Takes input as a list of Strings.

      @T6     - Get the sixth character of each string
    fn   \*Q  - And filter those that aren't equal to an asterisk.
m>d7          - Crop the first 7 characters.
              - Output implicitly.

COBOL (GnuCOBOL), 191 + 17 = 208 bytes

I "learned" COBOL for this answer, so it's probably not fully golfed.

This is a full program, taking input on what I presume to be standard input and writing to what I presume to be standard output. Perhaps one day I'll return to this and (1) determine whether COBOL has functions and, if so, (2) see whether a function solution would be shorter.

Byte count includes program and compiler flags (-free and -frelax-syntax).

program-id.c.select i assign keyboard line sequential.fd i. 1 l pic X(80). 88 e value 0.open input i perform until e read i end set e to true end-read if not e and l(7:1)<>'*'display l(8:73).

Try It Online

Ungolfed program

program-id. c.

select i assign to keyboard organization line sequential.

fd i.
    1 l pic X(80).
    88 e value 0.

open input i
perform until e
    read i
        end set e to true
    end-read
    if not e and l(7:1) <> '*'
        display l(8:73).

Limitations

The output is, technically speaking, not correct. From my cursory research, it seems the only practical way to store a string in COBOL is in a fixed-size buffer. I have chosen a buffer size of 80 characters, since this is the line length limit for fixed-format programs. This presents two limitations:

I'm guessing this is acceptable since, well, it's COBOL. If not, I'd be willing to look into alternatives.

Acknowledgments

Pyke, 9 bytes

36 4C 3E 23 64 DE 29 6D 74

Try it here!

Readable:

6L>#d.^)mt

Try it here!

6L>        -   [i[6:] for i in input]
   #d.^)   -  filter(i.startswith(" ") for  i in ^)
        mt - [i[-1:] for i in ^]

Perl 5, 19 + 1 (-p) = 20 16 bytes

-4 bytes with Pavel's suggestions

s/.{6}( |.*)//s

Try it online!

V, 13 11 10 bytes

Î6x<<
çª/d

Try it online!

Explanation

Î       ' On every line
  x     ' delete the first...
 6      ' 6 characters
   <<   ' and unindent the line (removes the leading space)
ç /     ' on every line
 ª      ' matching \*
   d    ' delete the line

Hexdump:

00000000: ce36 783c 3c0a e7aa 2f64                 .6x<<.../d

05AB1E, 11 bytes

|ʒ6èðQ}ε7F¦

Try it online!

Ruby, 39 38 36 29 23 22 20 + 1 = 21 bytes

$_[/.{6}( |.*
)/]=''

Try it online!

Uses -p flag.

Explanation:

The -p flag adds an implicit block around the code, so the code that actually gets run looks like this:

while gets
    $_[/.{6}( |.*
)/]=''

    puts $_
end

gets reads a line of text and stores its result in $_.

$_[/.../]='' removes the first occurence of the regex ... in $_.

/.{6}( |.*\n)/ matches 6 of any character at the start of a line, followed by either a space or the rest of the line. Because the space appears first, it will try to remove only the first 6 characters and a space before attempting to remove the entire line.

$_ is then printed out, and this process is repeated for each line.

PowerShell, 32 bytes

$input-replace'^.{6}( |.*)'-ne''

Try it online!

Pipeline input comes in as an array of strings, -replace works on every string, and -ne '' (not equal to empty string) applied to an array, acts to filter out the blank lines.

Octave, 23 bytes

@(s)s(s(:,7)~=42,8:end)

Try it online!

Gaia, 9 bytes

6>¦'*«⁈ḥ¦

A function accepting a list of strings and returning a list of strings.

Try it online!

Explanation

6>¦        Remove the first 6 characters of each string
   '*«⁈    Filter out ones that start with *
       ḥ¦  Remove the initial space from each

Python 2, 39 38 37 bytes

-1 byte thanks to LyricLy. -1 byte thanks to Mego.

lambda s:[i[7:]for i in s if'*'>i[6]]

Try it online!

I/O as lists of strings.

Actually, 13 bytes

⌠6@tp' =*⌡M;░

Input and output is done as a list of strings.

Explanation:

⌠6@tp' =*⌡M;░
⌠6@tp' =*⌡M    for each line:
 6@t             discard the first 6 characters
    p            pop the first character of the remainder
     ' =         is it a space?
        *        multiply the string by the boolean - returns the string if true, and an empty string if false
           ;░  filter out empty strings

Try it online!