First let me say thank you for the wealth of good information. I have been doing a lot of reading in areas of various parts of perl that have been called out in each of your replies. Terms like JSON, etc. Again, I am new and its a learning process. Using a personal project as a referance point for me makes it a little bit fun. I think the first response on using the map and undef helped me the most for now in understanding how I can carve up my data, but for some reason in my original post I think my example got butchered and I ran into another problem. It looks the editor field on this website does some strange wrapping of the line I am trying to work with. The end of the data in tstatcollect has a subsection that seems to break the original splits.

{"temp":75.50,"tmode":2,"fmode":0,"override":0,"hold":0,"t_cool":75.00 +,"tstate":0,"fstate":0,"time":{"day":4,"hour":13,"minute":49},"t_type +_p ost":0}
My working code now looks like
#! /usr/bin/perl open (FILE, '/home/julian/tstatcollect'); while (<FILE>) { chomp; (undef,$temp, undef,$tmode, undef,$fmode, undef,$override, undef,$hold +, undef,$tcool, undef,$tstate, undef,$fstate, undef,$time, undef,$day +, undef,$hour, undef,$minute, undef,$t_type_post,) = map split (":"), + split (","), ; print "Temperature: $temp\n"; print "Tmode: $tmode\n"; print "Fmode: $fmode\n"; print "Override: $override\n"; print "Hold: $hold\n"; print "tcool: $tcool\n"; print "tstate: $tstate\n"; print "fstate: $fstate\n"; print "day: $day\n"; print "hour: $hour\n"; print "minute: $minute\n"; print "t_type_post $t_type_post\n"; print "________\n"; } close (FILE); exit;
With an output now of
Temperature: 75.50 Tmode: 2 Fmode: 0 Override: 0 Hold: 0 tcool: 75.00 tstate: 0 fstate: 0 day: "hour" hour: "minute" minute: "t_type_post" t_type_post "
It seems as though when the regular format changes to something it doesnt expect the continuing parsing of the data goes to trash? My thought being is do I need do break the data into two forms. One with the first portion and another with the date time nested portion? I also liked the statement made earlier about collecting the data regardless of where its at with regards to the delimiter? Interesting. I apprecaite all the help and its giving me a lot of reading and researching to do for this weekend. I know there is a ton of resources and books written on the subject but without a referance point to start it made it hard to know what I was looking for. This gives me more to work with. Not looking for answers to the problem as much as I am looking for places to start learning. Thanks again. Julian


In reply to Re: Proper use of split by th3j4ckl3
in thread Proper use of split by th3j4ckl3

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.