in reply to can this text be recovered???
fmt isn't explicitly reversible, but it it doesn't necessarily hurt the 'meaning' - a textfile that's been formatted is still going to be readable. However what it's effectively doing is 'removing' your line boundaries, which are field delimiters used in 'sort' and 'uniq'
sort is removing information - the word order.
uniq is also removing information - the number of occurances of each word.
Oh, and the perl regexp is also removing information from your source data, which given it starts as postscript may be a problem.
Outside very trivial cases, a 'sort | uniq' will effectively destroy the meaning of the information contained in a file, and is effectively irreversible.
This doesn't necessarily mean all is lost, however you'll be reduced to jigsaw puzzle 'reconstruction' rather than any form of automatic process.
Start by reversing the rot13. That's trivial - just rot13 it again
Then you' get to try and figure out where the line breaks were. This _should_ be doable, because your text is sorted alphabetically - the 'start' of the next line will be alphabetically 'after' the start of the current line, and only 'just'.
Reversing the sort is going to be a guessing game I'm afraid. As is reversing the uniq. Because they both work on a full line at a time, it may be possible to do this, but I don't think postscript has any form of sequencing
Reversing the 'formatting strip', might again, be doable, but will require you to have a look at the postscript format. I seem to recall that postscript only tends to use '%'s and '/'s, which again, you may be able to reconstruct by guesswork, and by counting whitespace - cleartext is unlikely to have a triple space, so it might well be a good indicator that it was replacing ' / ' for example.
All the above is liable to be fairly time consuming, and there's no guarantee of success. A partial result (e.g. restore original content, rather than formatting) may be achieveable, but that depends an awful lot on what the source data were.
Of course, you could always go for plan B, and go hunting for 'filename.ps' in your collegue's home directory/elsewhere on the network.
|
|---|