Truusvlugindewind
Programmer
Sed, not sad...
Suppose you're maintaining cobol sources at a site and they have a rule never to remove code, but put an * in col7, so they have change-history. So, when you're scanning sources you constantly stumble over interesting history-lessons about that source, but you're interested in the actual "state of affairs" (stand van zaken).
Sounds familiar?
In my case I have downloaded all sources on a linux-machine so I can do impact analyses using "grep" (just scanning all sources) and guess what: a lot of history lessons...
If I only could remove those commented lines from my source...
Well, you can, using "sed". A unix/linux utility with (from a cobol's point-of-view) very criptical syntax. Believe it or not but when you run this script:
using a cobolsourcefile as input, you will get your 'pure' cobol source as output!
You cannot implement that version back at the client's site but you can use that for impact-analyses or compile it for your debugging-session.
P.S. when you are stuck to windows, you can install sed from here:
Suppose you're maintaining cobol sources at a site and they have a rule never to remove code, but put an * in col7, so they have change-history. So, when you're scanning sources you constantly stumble over interesting history-lessons about that source, but you're interested in the actual "state of affairs" (stand van zaken).
Sounds familiar?
In my case I have downloaded all sources on a linux-machine so I can do impact analyses using "grep" (just scanning all sources) and guess what: a lot of history lessons...
If I only could remove those commented lines from my source...
Well, you can, using "sed". A unix/linux utility with (from a cobol's point-of-view) very criptical syntax. Believe it or not but when you run this script:
Code:
$ cat omitComment.sh
#!/bin/sh
sed '/\*.\{7\}/d' < ${1}
You cannot implement that version back at the client's site but you can use that for impact-analyses or compile it for your debugging-session.
P.S. when you are stuck to windows, you can install sed from here: