understanding file name

2014-05-22
2014-05-26
  • I'm trying to erase unwanted files from a directory.
    My software changes some file names to have a comma
    and a number appended to the extension. I can't get
    Rexx to understand the name: xxxxxxxx.scr,1
    If there are two files with the same name, it only
    finds the one without the , in the extension.
    In the following example there are two files in
    the directory:

    xxxxxxxx.jrl
    xxxxxxxx.jrl,1

    do until lines(infile) = 0 / start the directory listing loop /
    l = (linein(infile)) / define the line variable /
    parse var l . / parse the line /
    if right(l,4) = '.jrl' then erase l / remove .jrl files /
    if right(l,6) = '.jrl,1' then erase l / remove ,1 files /
    if right(l,2) = ',2' then erase l / remove ,2 files /
    if right(l,2) = ',3' then erase l / remove ,3 files /
    if right(l,1) = '%' then erase l / remove % files /
    if right(l,7) = 'SAV.lnk' then erase l / remove the .SAV files /
    if right(l,4) = '.SAV' then erase l / remove the .SAV files /
    if l = 'AUTO.brd' then erase l / remove the AUTO.brd file /
    if l = 'signoise.run' then 'rmdir /s /q' l / remove the signoise.run dir /
    end / end the directory listing loop /

    After finding and erasing xxxxxxxx.jrl it gets to xxxxxxxx.jrl,1 and reports
    Could not find .......xxxxxxxx.jrl
    It doesn't understand that the file name continues past the comma.
    Any help would be appreciated.

     
    Last edit: Brant McClelland 2014-05-22
  • Sorry I had gotten no response.