Yep...
echo "1-2 2009-08-29 08:54:42;2-3 2009-09-02 01:29:29;3-4 2009-09-03 0
+8:24:46;4-5 2009-09-10 08:50:28;5-6 2010-06-29 08:26:43;6-7 2010-09-0
+3 10:45:47;7-8 2012-04-01 23:00:22;8-9 2012-04-28 12:09:22;9-10 2012-
+05-30 03:34:59;10-11 2014-11-30 09:34:57;11-12 2015-06-17 08:24:20" |
+ \
\
perl -nE '@a=split(/;/);for(@a){($a,$b)=split(/\s+(?=\d{4})/);say "$a:
+ $b";}'
1-2: 2009-08-29 08:54:42
2-3: 2009-09-02 01:29:29
3-4: 2009-09-03 08:24:46
4-5: 2009-09-10 08:50:28
5-6: 2010-06-29 08:26:43
6-7: 2010-09-03 10:45:47
7-8: 2012-04-01 23:00:22
8-9: 2012-04-28 12:09:22
9-10: 2012-05-30 03:34:59
10-11: 2014-11-30 09:34:57
11-12: 2015-06-17 08:24:20
# ^^^^^^^^^^ <- today of all days :)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|