in reply to couple of file content manipulation questions
The output of df is fixed length fields. You can use pack/unpack to get at the data. Read the pack tutorial on how this works. Basically, you calculate the field widths and feed them to pack which splits up the string for you. Then all your loop needs to do is recognize header and footer lines and handle them as special cases. Everything else is simply unpack()ed. No messy regexes.
Based on your data, I would do something like:
I notice that your data may be coming from different sources with different field widths. This may just be the cutting and pasting. But if it is so, you can actually use the header line of your data(from each machine) with index() to calculate the field widths and feed those to pack.
HTH
|
|---|