in reply to Re^3: Parsing output from a command
in thread Parsing output from a command

Hm. I got this output when I ran your code on the OP's data (c&p'd from the console window):

c:\test>junk4 hdisk0 0009E05B hdisk1 P1/Z1-Ab 16 Bit LVD SCSI Disk Drive (18200 MB) Manufacturer................IBM Machine Type and Model......ST318305LC FRU Number..................09P4437 Serial Number...............0004A0D2 Part Number.................09P4436

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^5: Parsing output from a command
by Limbic~Region (Chancellor) on Mar 24, 2009 at 19:06 UTC
    BrowserUk,
    The problem isn't what you suggest:
    That'll screw up on the last record because there is no "\nhdisk" delimiter following it.

    The problem is that the regex was anchored at ^. As I said, I had to make a minor modificiation to match the real AIX command (removing that). If you modify my code to drop the ^ it will work against the OP's DATA or the two modifications above if you want to run it on the real command.

    Cheers - L~R