Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

After Goliath's defeat, giants ceased to command respect. -- Freeman Dyson


devel / comp.lang.tcl / Clock scan

SubjectAuthor
* Clock scansnosniv
+* Clock scansnosniv
|`* Clock scansnosniv
| +- Clock scansaitology9
| `- Clock scanHarald Oehlmann
+- Clock scanRich
`* Clock scanGerald Lester
 `- Clock scanGerald Lester

1
Clock scan

<54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9959&group=comp.lang.tcl#9959

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:c64:b0:4bc:33f:4515 with SMTP id t4-20020a0562140c6400b004bc033f4515mr6360618qvj.44.1667303696961;
Tue, 01 Nov 2022 04:54:56 -0700 (PDT)
X-Received: by 2002:a0c:b295:0:b0:4ba:b9b4:5159 with SMTP id
r21-20020a0cb295000000b004bab9b45159mr15412155qve.19.1667303696777; Tue, 01
Nov 2022 04:54:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 1 Nov 2022 04:54:56 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=82.1.128.13; posting-account=gstOigoAAADV9pmzZL58qQ436SKV3SBu
NNTP-Posting-Host: 82.1.128.13
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
Subject: Clock scan
From: nivpars...@gmail.com (snosniv)
Injection-Date: Tue, 01 Nov 2022 11:54:56 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1308
 by: snosniv - Tue, 1 Nov 2022 11:54 UTC

I'm reading a csv file with date & time in one cell, however, the source file format doesn't seem to be constant, I sometimes get the following alternatives:
01/11/2022 11:00:27
and sometimes:
01 November 2022 11:00:27

So how to scan to ensure I get the seconds since epoch, using some way to detect the format with a switch or if statement??

TIA

Re: Clock scan

<07c123d8-3a83-4c40-8638-709dacb215bdn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9960&group=comp.lang.tcl#9960

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:ac8:5b81:0:b0:39c:b735:6b8b with SMTP id a1-20020ac85b81000000b0039cb7356b8bmr14602451qta.416.1667305294445;
Tue, 01 Nov 2022 05:21:34 -0700 (PDT)
X-Received: by 2002:ac8:594d:0:b0:39c:ebcb:913b with SMTP id
13-20020ac8594d000000b0039cebcb913bmr14602056qtz.501.1667305294255; Tue, 01
Nov 2022 05:21:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 1 Nov 2022 05:21:33 -0700 (PDT)
In-Reply-To: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.1.128.13; posting-account=gstOigoAAADV9pmzZL58qQ436SKV3SBu
NNTP-Posting-Host: 82.1.128.13
References: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <07c123d8-3a83-4c40-8638-709dacb215bdn@googlegroups.com>
Subject: Re: Clock scan
From: nivpars...@gmail.com (snosniv)
Injection-Date: Tue, 01 Nov 2022 12:21:34 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3154
 by: snosniv - Tue, 1 Nov 2022 12:21 UTC

On Tuesday, 1 November 2022 at 11:54:59 UTC, snosniv wrote:
> I'm reading a csv file with date & time in one cell, however, the source file format doesn't seem to be constant, I sometimes get the following alternatives:
> 01/11/2022 11:00:27
> and sometimes:
> 01 November 2022 11:00:27
>
> So how to scan to ensure I get the seconds since epoch, using some way to detect the format with a switch or if statement??
>
> TIA

My script did work, now failing miserably. I tried pasting some of the lines directly into tcl shell & now get this, which is really confusing me!
( I haven't shown the file read, split, etc to get the data rows from the CSV file).

(FIT_FILE_READ) 13 % puts $row
"1 November 2022 11:00:27",156.0,24.2,15.7,131.6,13.6,7.0,60.8,54.4,125.0,6.6,19.2,1658.0,64.0,--
(FIT_FILE_READ) 14 %
(FIT_FILE_READ) 14 % set row_data [split $row ","]
{"1 November 2022 11:00:27"} 156.0 24.2 15.7 131.6 13.6 7.0 60.8 54.4 125.0 6.6 19.2 1658.0 64.0 --
(FIT_FILE_READ) 15 %
(FIT_FILE_READ) 15 % set my_DateTime [lindex $row_data 0]
"1 November 2022 11:00:27"
(FIT_FILE_READ) 16 % set my_tcl_time [clock scan $my_DateTime -format "%d %B %Y %H:%M:%S"]
input string does not match supplied format
(FIT_FILE_READ) 17 % set my_tcl_time [clock scan $my_DateTime -format "%d %M %Y %H:%M:%S"]
input string does not match supplied format
(FIT_FILE_READ) 18 % set my_tcl_time [clock scan $my_DateTime -format "%D %M %Y %H:%M:%S"]
input string does not match supplied format
(FIT_FILE_READ) 19 % set my_tcl_time [clock scan $my_DateTime -format "%D %B %Y %H:%M:%S"]
input string does not match supplied format
(FIT_FILE_READ) 20 %
(FIT_FILE_READ) 20 % set my_tcl_time [clock scan $my_DateTime -format "%d %m %Y %H:%M:%S"]
input string does not match supplied format
(FIT_FILE_READ) 21 %
(FIT_FILE_READ) 21 % set my_tcl_time [clock scan $my_DateTime -format "%d %B %Y %H:%M:%S"]
input string does not match supplied format
(FIT_FILE_READ) 22 % puts $my_DateTime
"1 November 2022 11:00:27"
(FIT_FILE_READ) 23 %

Re: Clock scan

<8d364303-79f2-46aa-8809-67ccce8925c6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9961&group=comp.lang.tcl#9961

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:c64:b0:4bc:33f:4515 with SMTP id t4-20020a0562140c6400b004bc033f4515mr6631603qvj.44.1667307484579;
Tue, 01 Nov 2022 05:58:04 -0700 (PDT)
X-Received: by 2002:a05:6214:2608:b0:4bb:b0d4:2346 with SMTP id
gu8-20020a056214260800b004bbb0d42346mr15620411qvb.26.1667307484373; Tue, 01
Nov 2022 05:58:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Tue, 1 Nov 2022 05:58:04 -0700 (PDT)
In-Reply-To: <07c123d8-3a83-4c40-8638-709dacb215bdn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.1.128.13; posting-account=gstOigoAAADV9pmzZL58qQ436SKV3SBu
NNTP-Posting-Host: 82.1.128.13
References: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com> <07c123d8-3a83-4c40-8638-709dacb215bdn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8d364303-79f2-46aa-8809-67ccce8925c6n@googlegroups.com>
Subject: Re: Clock scan
From: nivpars...@gmail.com (snosniv)
Injection-Date: Tue, 01 Nov 2022 12:58:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4251
 by: snosniv - Tue, 1 Nov 2022 12:58 UTC

On Tuesday, 1 November 2022 at 12:21:36 UTC, snosniv wrote:
> On Tuesday, 1 November 2022 at 11:54:59 UTC, snosniv wrote:
> > I'm reading a csv file with date & time in one cell, however, the source file format doesn't seem to be constant, I sometimes get the following alternatives:
> > 01/11/2022 11:00:27
> > and sometimes:
> > 01 November 2022 11:00:27
> >
> > So how to scan to ensure I get the seconds since epoch, using some way to detect the format with a switch or if statement??
> >
> > TIA
> My script did work, now failing miserably. I tried pasting some of the lines directly into tcl shell & now get this, which is really confusing me!
> ( I haven't shown the file read, split, etc to get the data rows from the CSV file).
>
> (FIT_FILE_READ) 13 % puts $row
> "1 November 2022 11:00:27",156.0,24.2,15.7,131.6,13.6,7.0,60.8,54.4,125.0,6.6,19.2,1658.0,64.0,--
> (FIT_FILE_READ) 14 %
> (FIT_FILE_READ) 14 % set row_data [split $row ","]
> {"1 November 2022 11:00:27"} 156.0 24.2 15.7 131.6 13.6 7.0 60.8 54.4 125.0 6.6 19.2 1658.0 64.0 --
> (FIT_FILE_READ) 15 %
> (FIT_FILE_READ) 15 % set my_DateTime [lindex $row_data 0]
> "1 November 2022 11:00:27"
> (FIT_FILE_READ) 16 % set my_tcl_time [clock scan $my_DateTime -format "%d %B %Y %H:%M:%S"]
> input string does not match supplied format
> (FIT_FILE_READ) 17 % set my_tcl_time [clock scan $my_DateTime -format "%d %M %Y %H:%M:%S"]
> input string does not match supplied format
> (FIT_FILE_READ) 18 % set my_tcl_time [clock scan $my_DateTime -format "%D %M %Y %H:%M:%S"]
> input string does not match supplied format
> (FIT_FILE_READ) 19 % set my_tcl_time [clock scan $my_DateTime -format "%D %B %Y %H:%M:%S"]
> input string does not match supplied format
> (FIT_FILE_READ) 20 %
> (FIT_FILE_READ) 20 % set my_tcl_time [clock scan $my_DateTime -format "%d %m %Y %H:%M:%S"]
> input string does not match supplied format
> (FIT_FILE_READ) 21 %
> (FIT_FILE_READ) 21 % set my_tcl_time [clock scan $my_DateTime -format "%d %B %Y %H:%M:%S"]
> input string does not match supplied format
> (FIT_FILE_READ) 22 % puts $my_DateTime
> "1 November 2022 11:00:27"
> (FIT_FILE_READ) 23 %

It looks like the DateTime with the quotes is causing the issue!
I didn't get these errors before, and nothing seems to have changed in the way the source CSV file gets saved, and script unchanged:
so I tried this:
(FIT_FILE_READ) 21 % puts $my_DateTime
"01 November 2022 11:00:27"
(FIT_FILE_READ) 23 % set s1 $my_DateTime
"01 November 2022 11:00:27"
(FIT_FILE_READ) 24 % set x1 [string length $s1]
27
(FIT_FILE_READ) 25 % set s2 [string range $s1 1 25] ; # strip out the quotes from start & end.
01 November 2022 11:00:27
(FIT_FILE_READ) 28 % set t1 [clock scan $s1 -format "%d %B %Y %H:%M:%S"]
input string does not match supplied format
(FIT_FILE_READ) 29 % set t1 [clock scan $s2 -format "%d %B %Y %H:%M:%S"]
1667300427

Can someone explain what I'm doing wrong please, I seem to be constantly editing my script to solve what seems to be ever moving formats?

TIA, Niv.

Re: Clock scan

<tjr6hb$10oe$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9962&group=comp.lang.tcl#9962

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!a5rWVvs5S5ZXUwkNcVnRMw.user.46.165.242.75.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: Clock scan
Date: Tue, 1 Nov 2022 09:21:45 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tjr6hb$10oe$1@gioia.aioe.org>
References: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
<07c123d8-3a83-4c40-8638-709dacb215bdn@googlegroups.com>
<8d364303-79f2-46aa-8809-67ccce8925c6n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="33550"; posting-host="a5rWVvs5S5ZXUwkNcVnRMw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: saitology9 - Tue, 1 Nov 2022 13:21 UTC

On 11/1/2022 8:58 AM, snosniv wrote:
>> My script did work, now failing miserably. I tried pasting some of the lines directly into tcl shell & now get this, which is really confusing me!
>> ( I haven't shown the file read, split, etc to get the data rows from the CSV file).
>>
>> (FIT_FILE_READ) 13 % puts $row
>> "1 November 2022 11:00:27",156.0,24.2,15.7,131.6,13.6,7.0,60.8,54.4,125.0,6.6,19.2,1658.0,64.0,--
>> (FIT_FILE_READ) 14 %
>> (FIT_FILE_READ) 14 % set row_data [split $row ","]
>> {"1 November 2022 11:00:27"} 156.0 24.2 15.7 131.6 13.6 7.0 60.8 54.4 125.0 6.6 19.2 1658.0 64.0 --

The problem is with your data and it starts right here: Your split is
combining the double-quotes with your date data. It seems that your
data now contains extra characters that were not there before. See if
you can the cvs package in the tcllib for better results.

By the way,

>> (FIT_FILE_READ) 16 % set my_tcl_time [clock scan $my_DateTime -format "%d %B %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 17 % set my_tcl_time [clock scan $my_DateTime -format "%d %M %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 18 % set my_tcl_time [clock scan $my_DateTime -format "%D %M %Y %H:%M:%S"]
>> input string does not match supplied format

I would not recommend going down the list of different formats until one
sticks. Lots of room for data quality errors there. It might be better
to fix your data file format.

Re: Clock scan

<tjr6v4$o009$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9963&group=comp.lang.tcl#9963

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: Clock scan
Date: Tue, 1 Nov 2022 14:29:08 +0100
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <tjr6v4$o009$2@dont-email.me>
References: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
<07c123d8-3a83-4c40-8638-709dacb215bdn@googlegroups.com>
<8d364303-79f2-46aa-8809-67ccce8925c6n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Nov 2022 13:29:08 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="afca5c659a392fda99d59d22c85bb0b2";
logging-data="786441"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PGkJw6ZizJl0g67zGewjx"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.1
Cancel-Lock: sha1:u3b6C87g/UAqSfECevTpwfOlicc=
In-Reply-To: <8d364303-79f2-46aa-8809-67ccce8925c6n@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Tue, 1 Nov 2022 13:29 UTC

Am 01.11.2022 um 13:58 schrieb snosniv:
> On Tuesday, 1 November 2022 at 12:21:36 UTC, snosniv wrote:
>> On Tuesday, 1 November 2022 at 11:54:59 UTC, snosniv wrote:
>>> I'm reading a csv file with date & time in one cell, however, the source file format doesn't seem to be constant, I sometimes get the following alternatives:
>>> 01/11/2022 11:00:27
>>> and sometimes:
>>> 01 November 2022 11:00:27
>>>
>>> So how to scan to ensure I get the seconds since epoch, using some way to detect the format with a switch or if statement??
>>>
>>> TIA
>> My script did work, now failing miserably. I tried pasting some of the lines directly into tcl shell & now get this, which is really confusing me!
>> ( I haven't shown the file read, split, etc to get the data rows from the CSV file).
>>
>> (FIT_FILE_READ) 13 % puts $row
>> "1 November 2022 11:00:27",156.0,24.2,15.7,131.6,13.6,7.0,60.8,54.4,125.0,6.6,19.2,1658.0,64.0,--
>> (FIT_FILE_READ) 14 %
>> (FIT_FILE_READ) 14 % set row_data [split $row ","]
>> {"1 November 2022 11:00:27"} 156.0 24.2 15.7 131.6 13.6 7.0 60.8 54.4 125.0 6.6 19.2 1658.0 64.0 --
>> (FIT_FILE_READ) 15 %
>> (FIT_FILE_READ) 15 % set my_DateTime [lindex $row_data 0]
>> "1 November 2022 11:00:27"
>> (FIT_FILE_READ) 16 % set my_tcl_time [clock scan $my_DateTime -format "%d %B %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 17 % set my_tcl_time [clock scan $my_DateTime -format "%d %M %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 18 % set my_tcl_time [clock scan $my_DateTime -format "%D %M %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 19 % set my_tcl_time [clock scan $my_DateTime -format "%D %B %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 20 %
>> (FIT_FILE_READ) 20 % set my_tcl_time [clock scan $my_DateTime -format "%d %m %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 21 %
>> (FIT_FILE_READ) 21 % set my_tcl_time [clock scan $my_DateTime -format "%d %B %Y %H:%M:%S"]
>> input string does not match supplied format
>> (FIT_FILE_READ) 22 % puts $my_DateTime
>> "1 November 2022 11:00:27"
>> (FIT_FILE_READ) 23 %
>
> It looks like the DateTime with the quotes is causing the issue!
> I didn't get these errors before, and nothing seems to have changed in the way the source CSV file gets saved, and script unchanged:
> so I tried this:
> (FIT_FILE_READ) 21 % puts $my_DateTime
> "01 November 2022 11:00:27"
> (FIT_FILE_READ) 23 % set s1 $my_DateTime
> "01 November 2022 11:00:27"
> (FIT_FILE_READ) 24 % set x1 [string length $s1]
> 27
> (FIT_FILE_READ) 25 % set s2 [string range $s1 1 25] ; # strip out the quotes from start & end.
> 01 November 2022 11:00:27
> (FIT_FILE_READ) 28 % set t1 [clock scan $s1 -format "%d %B %Y %H:%M:%S"]
> input string does not match supplied format
> (FIT_FILE_READ) 29 % set t1 [clock scan $s2 -format "%d %B %Y %H:%M:%S"]
> 1667300427
>
> Can someone explain what I'm doing wrong please, I seem to be constantly editing my script to solve what seems to be ever moving formats?
>
> TIA, Niv.

Dear Niv,

thank you. The double-quotes (") are part of the CSV file, not part of
the data. You may consider to decode the CSV format using a present
method, which may handle the double-quotes.

You may choose:
- csv module of TCLLIB : https://wiki.tcl-lang.org/page/Tcllib+Csv
- csv parser on the wiki: https://wiki.tcl-lang.org/page/csv
- Ashoks binary rclcsv package: https://wiki.tcl-lang.org/page/tclcsv

Take care,
Harald

Re: Clock scan

<tjrcgp$q1nu$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9965&group=comp.lang.tcl#9965

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Clock scan
Date: Tue, 1 Nov 2022 15:03:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <tjrcgp$q1nu$2@dont-email.me>
References: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
Injection-Date: Tue, 1 Nov 2022 15:03:53 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="976f85e8b9aa8267b18aa2f750b2de52";
logging-data="853758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TzE6LyYiTdKjBJuUn9Bbq"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:1nW0e7h84e2RZOEZXWpL8Q4PNRU=
 by: Rich - Tue, 1 Nov 2022 15:03 UTC

snosniv <nivparsons@gmail.com> wrote:
> I'm reading a csv file with date & time in one cell, however, the
> source file format doesn't seem to be constant, I sometimes get the
> following alternatives:

> 01/11/2022 11:00:27
> and sometimes:
> 01 November 2022 11:00:27
>
> So how to scan to ensure I get the seconds since epoch, using some
> way to detect the format with a switch or if statement??

If your input CSV file has varying formats for the date, then yes, you
will have to do one of:

1) detect what format a given row contains, and then scan that format.

or

2) determine how many variant formats the file contains, and scan for
each in sequence until one does not error (you'll have to wrap the
clock scan in a [catch] or a [try] block and handle the errors as "try
next possible format". Also note that until you detect all the variant
formats, you'll want a final "could not parse this string: '.....'" log
output so you can add to your formats

or

3) get the producer of the csv files to stop creating different date
formats and always output a standard format for all date/times.

Also, in a followup it looks like you might be using [split] to parse
the CSV file. DO NOT DO THIS. CSV's quoting method will cause a
simple [split] to fail once a row that is quoted appears.

ALWAYS use Tcllib's CSV module to parse CSV files, it will handle the
troublesome details for you.

Also, ALWAYS use Tcllib's CSV module to output CSV rows, as it will
also handle adding required quoting for you as well.

Re: Clock scan

<tjrp4c$13q1$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9974&group=comp.lang.tcl#9974

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!W8/fhIku2mFEvQF8+99Hqw.user.46.165.242.75.POSTED!not-for-mail
From: Gerald.L...@KnG-Consulting.net (Gerald Lester)
Newsgroups: comp.lang.tcl
Subject: Re: Clock scan
Date: Tue, 1 Nov 2022 13:39:07 -0500
Organization: KnG Consulting, LLC
Message-ID: <tjrp4c$13q1$1@gioia.aioe.org>
References: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="36673"; posting-host="W8/fhIku2mFEvQF8+99Hqw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Gerald Lester - Tue, 1 Nov 2022 18:39 UTC

On 11/1/22 06:54, snosniv wrote:
> I'm reading a csv file with date & time in one cell, however, the source file format doesn't seem to be constant, I sometimes get the following alternatives:
> 01/11/2022 11:00:27
> and sometimes:
> 01 November 2022 11:00:27
>
> So how to scan to ensure I get the seconds since epoch, using some way to detect the format with a switch or if statement??

Normally, at least in the US, it is mm/dd/YYYY -- are you sure that:
"01/11/2022 11:00:27" is "01 November 2022 11:00:27"
and not:
"01/11/2022 11:00:27" is "11 January 2022 11:00:27"

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald.Lester@kng-consulting.net |
+----------------------------------------------------------------------+

Re: Clock scan

<tjrp76$13q1$2@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9975&group=comp.lang.tcl#9975

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!W8/fhIku2mFEvQF8+99Hqw.user.46.165.242.75.POSTED!not-for-mail
From: Gerald.L...@KnG-Consulting.net (Gerald Lester)
Newsgroups: comp.lang.tcl
Subject: Re: Clock scan
Date: Tue, 1 Nov 2022 13:40:38 -0500
Organization: KnG Consulting, LLC
Message-ID: <tjrp76$13q1$2@gioia.aioe.org>
References: <54498bfb-4b19-48f2-84ab-00a1ee196531n@googlegroups.com>
<tjrp4c$13q1$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="36673"; posting-host="W8/fhIku2mFEvQF8+99Hqw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Gerald Lester - Tue, 1 Nov 2022 18:40 UTC

On 11/1/22 13:39, Gerald Lester wrote:
> On 11/1/22 06:54, snosniv wrote:
>> I'm reading a csv file with date & time in one cell, however, the
>> source file format doesn't seem to be constant, I sometimes get the
>> following alternatives:
>> 01/11/2022  11:00:27
>>   and sometimes:
>> 01 November 2022  11:00:27
>>
>> So how to scan to ensure I get  the seconds since epoch, using some
>> way to detect the format with a switch or if statement??
>
> Normally, at least in the US, it is mm/dd/YYYY -- are you sure that:
>   "01/11/2022  11:00:27" is "01 November 2022  11:00:27"
> and not:
>   "01/11/2022  11:00:27" is "11 January 2022  11:00:27"
>

BTW, if it is:
"01/11/2022 11:00:27" is "11 January 2022 11:00:27"

Then clock scan returns the same value either way.

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald.Lester@kng-consulting.net |
+----------------------------------------------------------------------+

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor