in reply to how to read values from a given paragraph

If I understand it well, you have one line of input
BRNO MAGNO SLOTNO PRODNO PRODREV 31 1 14 ROJ 208 882/1 R1C PRODNAM MA +NDATE SERNO MASTRP GED-DVD 20090604 CB49914646 1021 SLSTATE DATE TIME + 0 120628 131219

And you need the values of <PRODNAM>,<PRODNO>,<PRODREV> and <SERNO>.

Please tell us what part of the input line relates to each of <PRODNAM>,<PRODNO>,<PRODREV> and <SERNO>.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: how to read values from a given paragraph
by get2vijay (Novice) on May 07, 2015 at 07:30 UTC
    hi thanks for replying the values are mentioned exactly below these strings: BRNO MAGNO SLOTNO PRODNO PRODREV 31 1 14 ROJ 208 882/1 R1C PRODNAM MANDATE SERNO MASTRP GED-DVD 20090604 CB49914646 1021 SLSTATE DATE TIME 0 120628 131219 for e.g PRODNO=ROJ 208 882/1 PRODREV=R1C PRODNAM=GED-DVD SERNO=CB49914646 These values keeps changing everytime. thanks and regards

      No, the values are not "mentioned exactly below these strings." Look at your own posts in this thread. See how your sample data is in one long string that wraps wherever it may, instead of the multiple lines of the original file, so you can't tell where the columns line up? Did you notice that it didn't look right when you previewed all these posts?

      You've been told in this thread how to prevent that with code tags, so that people can understand your data and help you. The instructions above and below the posting textarea also tell you how. Had you done so, you would have had an answer to your first post a few hours ago. Please take a few moments to learn to post correctly, so that we can help you.

      Aaron B.
      Available for small or large Perl jobs and *nix system administration; see my home node.

      Why omit code tags? They're also used for data