From lembark at wrkhors.com Fri May 3 13:40:30 2024 From: lembark at wrkhors.com (Steven Lembark) Date: Fri, 3 May 2024 16:40:30 -0400 Subject: [Chicago-talk] parsing lines In-Reply-To: References: Message-ID: <20240503164030.2e98fc53.lembark@wrkhors.com> On Wed, 24 Apr 2024 15:00:21 -0500 Jay S wrote: > Hi no worries. > Like I said in playing with the data it became harder to do the > parsing I needed. > long story short, I requested (and was given) the data in CSV Make your life easier: Choose a delimeted format (CSV is recursive). Pick something other than a ',' for the separator: '|' is usually a good choice. At that point you don't need to deal with escaped separators, quoted escapes of escaped quotes of separators... blech. Your entire input process becomes: my @fieldz = split $sep => $input; and you're done. If the raw input doesn't include literal tabs, tab separated ("TSV") is common and makes it easy to look at the files using *nix command line tools like cut and grep. -- Steven Lembark Workhorse Computing lembark at wrkhors.com +1 888 359 3508 From me at heyjay.com Sun May 5 16:07:50 2024 From: me at heyjay.com (Jay S) Date: Sun, 5 May 2024 18:07:50 -0500 Subject: [Chicago-talk] parsing lines In-Reply-To: <20240503164030.2e98fc53.lembark@wrkhors.com> References: <20240503164030.2e98fc53.lembark@wrkhors.com> Message-ID: thanks Steve. I had asked for a new, delimited file, and got it On Fri, May 3, 2024 at 3:39?PM Steven Lembark wrote: > On Wed, 24 Apr 2024 15:00:21 -0500 > Jay S wrote: > > > Hi no worries. > > Like I said in playing with the data it became harder to do the > > parsing I needed. > > long story short, I requested (and was given) the data in CSV > > Make your life easier: Choose a delimeted format (CSV is recursive). > > Pick something other than a ',' for the separator: '|' is usually a > good choice. At that point you don't need to deal with escaped > separators, quoted escapes of escaped quotes of separators... blech. > > Your entire input process becomes: > > my @fieldz = split $sep => $input; > > and you're done. > > If the raw input doesn't include literal tabs, tab separated ("TSV") > is common and makes it easy to look at the files using *nix command > line tools like cut and grep. > > > > -- > Steven Lembark > Workhorse Computing > lembark at wrkhors.com > +1 888 359 3508 > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > https://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: