Category : Miscellaneous Language Source Code
Archive   : QTAWKU42.ZIP
Filename : FILENAME.EXP

 
Output of file : FILENAME.EXP contained in archive : QTAWKU42.ZIP
# QTAwk utility to split input lines into DOS path and filename.ext
#
BEGIN {
# characters excluded from filename
# all other characters are valid filename characters for DOS
exc_c = /[!\x01-\x21."\/\\\[\]:|<>+=;,]/;
# DOS filename.ext pattern
# filename consists of all characters not excluded from proper name
# followed by optional extension of 1 to 3 characters
# followed by end of string
name_pat = /{exc_c}+(\.{exc_c}{1,3})?$/;
}

# split each line into "path" and "filename"
# strategy: delete "filename.ext" from end using regular expression
# to recognize and "sub" function to replace with zero length string.
# use "substr" function to then get suffix of path, which is the
# filename.ext. This strategy works even if filename.ext is not present.
#
{
# everything into path
path = $0;
# delete filename.ext at end to leave path
sub(name_pat,"",path);
# get suffix of path, which is filename.ext
filename = substr($0,1 + length(path));

print path;
print filename;
}


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : QTAWKU42.ZIP
Filename : FILENAME.EXP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/