using DD to pull records out of a data file
I there any way to use DD to pull the last 500 records? without knowing how many records total there are, and simply subtracting 500 from that and saying skip (that number)??
|
Nope ... dd references everything from the beginning
of file. But if the records are lines (\n - separated) you could use tail -n 500 Cheers, Tink |
thats what i thought....
figured it couldn't hurt to ask... and of course it wouldn't be so easy that the records were all on new lines, I am working on getting a math expression down for it now... |
Well ... if it has SOME sort of designated delimiter you
could always pipe it through awk and run tail against its output ... Cheers, Tink |
i guess i should explain what i am doing a little more
I am taking a file with ebcdic data in it, and trying to take the first 500 reords, convert them to ascii, then output to a file. and the same for the last 500 records to a different file. I haven't been informed of a delimiter of any kind, I was just told to go by byte length for the records. I guess this is the reason they want me using DD. |
Oh, I see :)
So they have a fixed record length? In that case getting the last 500 mathematically is trivial, neh? :) And I agree, considering the EBCDIC/ASCII conversion dd would be the best tool for the job :) Cheers, Tink |
yeah, I got it all done now... I was just trying to avoid using math if i could. :)
thanks for the help :) |
All times are GMT -5. The time now is 09:03 AM. |