Author Topic: realtime.txt 24 hr vs 12 format issue  (Read 8419 times)

Ktuley

  • Gentle Breeze
  • **
  • Posts: 22
    • CW7923
    • KNMALBUQ8
  • Station Details: Vantage Vue 2, iMac (M1) 2021
realtime.txt 24 hr vs 12 format issue
« on: July 10, 2019, 05:09:21 PM »
I've just noticed that my WCT_realtime.txt file has a number of times formatted in 12 hour format... ie, 7:25 AM, this extra space breaks the format, as a space is supposed to be separator.

Here's a sample of the data....you can see the first time is in 24 hour format (blue)...the ones that are some other stat specific (red) has the issues.

10/07/19 10:00:45 83.4 14 29.2 1 0 355 0.00 0.00 29.95 N - kts F in in 1.87 -0.01 0.06 2.66 0.00 77.9 33 83.4 6.0 83.4 10:00 AM 60.8 4:01 AM 8 9:51 AM 8 9:51 AM 29.96 9:00 AM 29.85 12:02 AM VERS BLD - 8 83.4 - 0.0 - 0 355

any ideas on how to fix this?

iccb

  • Gentle Breeze
  • **
  • Posts: 71
    • S??tilanne Eurassa
  • Station Details: Mac Mini (late 2018), Davis Vantage Pro2
Re: realtime.txt 24 hr vs 12 format issue
« Reply #1 on: July 10, 2019, 06:29:08 PM »
You can test to change your Mac?s time to 24h if it is not..

Dave13

  • Gentle Breeze
  • **
  • Posts: 63
    • CW7890
    • KTNPARSO2
    • ParsonsWeather.com
  • Station Details: Davis VP2
Change the first 2 tags in your source WCT_realtime.txt file from: de$|t24s$|
To this: da$|t12s$|

This is what my processed WCT_realtime.txt file looks like:
07/10/19|12:32:11 PM|82.5|82|76.4|0|0|53|0.00|0.02|29.97|NE|-|MPH|°F|inHg|in|1.42|-0.01|1.82|32.37|0.00|72.7|55|82.5|0.2|83.6|11:06 AM|75.0|5:45 AM|7|11:30 AM|7|11:30 AM|29.99|11:18 AM|29.91|3:50 AM|V3.04, Build 91 (64 bit)|-|0|90.6|-|3.6|-|295|53|-|-|-|-|NE|


Don?t use the MacOS TextEdit app for editing txt or php files, it can change the file's formatting which can cause issues. I use BBEdit, it will preserve the file formatting.
BBEdit is a paid app but the basic editing features work in ?free mode?. You can get it in the Mac App Store or on the developer?s website here: https://www.barebones.com/products/bbedit/index.html

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: realtime.txt 24 hr vs 12 format issue
« Reply #3 on: July 10, 2019, 11:02:07 PM »
TextEdit can and has always been able to read/write text files. ThU5:-) You simply need to change its default format from RTF to TXT. It's a simple click of the "Plain text" radio button in the TextEdit->Preferences, New Document:Format section. Second, check the 'Add ".txt" extension to plain text files' in the TextEdit->Preferences->Open and Save section. By the way, I suggest changing, the Finder->Preferences->Advanced, to "Show all filename extensions". ThU32:-)

TextEdit can be used to read/write plain text, HTML, XML, Basic, Pascal, PHP, C++, .plist, etc., etc. You just need to Save as ".txt" and then change those 3 letters to whatever the other language needs. Of course, you won't have the color coding that BBEdit or a compiler would provide but all those languages are simply text files until a compiler/interpreter is needed.

BBEdit is great, I've used it for decades, but one should open, inspect and know what any app's Prefs can do for you. Especially those apps that Apple gives you. Just because Apple thinks we should do things their way does not mean we actually have to. [banghead] I used Filemaker on the 128K Mac(!), as a page layout app before Pages was ever a gleam in Steve Job's eye! [computer] cmu:-)
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Ktuley

  • Gentle Breeze
  • **
  • Posts: 22
    • CW7923
    • KNMALBUQ8
  • Station Details: Vantage Vue 2, iMac (M1) 2021
Change the first 2 tags in your source WCT_realtime.txt file from: de$|t24s$|
To this: da$|t12s$|

This is what my processed WCT_realtime.txt file looks like:
07/10/19|12:32:11 PM|82.5|82|76.4|0|0|53|0.00|0.02|29.97|NE|-|MPH|°F|inHg|in|1.42|-0.01|1.82|32.37|0.00|72.7|55|82.5|0.2|83.6|11:06 AM|75.0|5:45 AM|7|11:30 AM|7|11:30 AM|29.99|11:18 AM|29.91|3:50 AM|V3.04, Build 91 (64 bit)|-|0|90.6|-|3.6|-|295|53|-|-|-|-|NE|


Don?t use the MacOS TextEdit app for editing txt or php files, it can change the file's formatting which can cause issues. I use BBEdit, it will preserve the file formatting.


Thanks.... the tag change doesn't seem to work. I still end up with a space between the time and the AM/PM indicator.... I have spaces as delimiters, while you have pipes...wondering about that... and I usually use BBEdit.. love it for the find and replace functions.
anyway, would you mind sending me a copy of your WCT_realtime.txt template?  I've probably screwed up mine with all the different things I've tried...and even the original version I had was suspect.

Thanks

Ken

Ktuley

  • Gentle Breeze
  • **
  • Posts: 22
    • CW7923
    • KNMALBUQ8
  • Station Details: Vantage Vue 2, iMac (M1) 2021
Re: realtime.txt 24 hr vs 12 format issue
« Reply #5 on: July 11, 2019, 12:04:22 AM »

BBEdit is great, I've used it for decades, but one should open, inspect and know what any app's Prefs can do for you. Especially those apps that Apple gives you. Just because Apple thinks we should do things their way does not mean we actually have to. [banghead] I used Filemaker on the 128K Mac(!), as a page layout app before Pages was ever a gleam in Steve Job's eye! [computer] cmu:-)

I LOVE Filemaker.  been using it since v3.  just wish I had more things to do with it. (used it a lot for work, now that I'm retired, not as many uses)

Ken

Ktuley

  • Gentle Breeze
  • **
  • Posts: 22
    • CW7923
    • KNMALBUQ8
  • Station Details: Vantage Vue 2, iMac (M1) 2021
Re: realtime.txt 24 hr vs 12 format issue
« Reply #6 on: July 11, 2019, 12:07:09 AM »
You can test to change your Mac?s time to 24h if it is not..

Tried it... doesn't seem to change anything. Thanks for the thought!

Ken

Dave13

  • Gentle Breeze
  • **
  • Posts: 63
    • CW7890
    • KTNPARSO2
    • ParsonsWeather.com
  • Station Details: Davis VP2
Re: realtime.txt 24 hr vs 12 format issue
« Reply #7 on: July 11, 2019, 01:39:48 PM »
TextEdit can and has always been able to read/write text files. ThU5:-) You simply need to change its default format from RTF to TXT. It's a simple click of the "Plain text" radio button in the TextEdit->Preferences, New Document:Format section. Second, check the 'Add ".txt" extension to plain text files' in the TextEdit->Preferences->Open and Save section. By the way, I suggest changing, the Finder->Preferences->Advanced, to "Show all filename extensions". ThU32:-)

TextEdit can be used to read/write plain text, HTML, XML, Basic, Pascal, PHP, C++, .plist, etc., etc. You just need to Save as ".txt" and then change those 3 letters to whatever the other language needs. Of course, you won't have the color coding that BBEdit or a compiler would provide but all those languages are simply text files until a compiler/interpreter is needed.

BBEdit is great, I've used it for decades, but one should open, inspect and know what any app's Prefs can do for you. Especially those apps that Apple gives you. Just because Apple thinks we should do things their way does not mean we actually have to. [banghead] I used Filemaker on the 128K Mac(!), as a page layout app before Pages was ever a gleam in Steve Job's eye! [computer] cmu:-)


I am well aware that you can edit plain text files with TextEdit, but that app has on many occasions changed it default settings back from plain text format to RTF.

This is why I encourage the use of BBEdit, it works so much better than TextEdit, you avoid the formatting issue and manually changing file extensions.

Dave13

  • Gentle Breeze
  • **
  • Posts: 63
    • CW7890
    • KTNPARSO2
    • ParsonsWeather.com
  • Station Details: Davis VP2
Change the first 2 tags in your source WCT_realtime.txt file from: de$|t24s$|
To this: da$|t12s$|

This is what my processed WCT_realtime.txt file looks like:
07/10/19|12:32:11 PM|82.5|82|76.4|0|0|53|0.00|0.02|29.97|NE|-|MPH|°F|inHg|in|1.42|-0.01|1.82|32.37|0.00|72.7|55|82.5|0.2|83.6|11:06 AM|75.0|5:45 AM|7|11:30 AM|7|11:30 AM|29.99|11:18 AM|29.91|3:50 AM|V3.04, Build 91 (64 bit)|-|0|90.6|-|3.6|-|295|53|-|-|-|-|NE|


Don’t use the MacOS TextEdit app for editing txt or php files, it can change the file's formatting which can cause issues. I use BBEdit, it will preserve the file formatting.


Thanks.... the tag change doesn't seem to work. I still end up with a space between the time and the AM/PM indicator.... I have spaces as delimiters, while you have pipes...wondering about that... and I usually use BBEdit.. love it for the find and replace functions.
anyway, would you mind sending me a copy of your WCT_realtime.txt template?  I've probably screwed up mine with all the different things I've tried...and even the original version I had was suspect.

Thanks

Ken


Attached to this post is the original WCT_realtime.txt. Also attached is WCT_realtime-2.txt, which has the first 2 tags changed to 12 hour formatting, this is what I have used without issue since day 1.

The spaces between the time and the AM/PM indicator are done by WeatherCat when it processes the tags in that file. Look at my last post where I pasted the output of my WCT_reatime.txt processed file and you'll see the spaces in the times.

The pipes for a delimiter are default for that file to work with the Saratoga templates.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: realtime.txt 24 hr vs 12 format issue
« Reply #9 on: July 11, 2019, 04:04:03 PM »
Quote
TextEdit, but that app has on many occasions changed it default settings back from plain text format to RTF.
Thanks for the warning, I've never seen that. I did notice that my wife's new MBP (with Mojave macOS 10.14 preinstalled) came with the default set to RTF. [banghead]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system


Dave13

  • Gentle Breeze
  • **
  • Posts: 63
    • CW7890
    • KTNPARSO2
    • ParsonsWeather.com
  • Station Details: Davis VP2
Re: realtime.txt 24 hr vs 12 format issue
« Reply #10 on: July 11, 2019, 04:49:53 PM »
Quote
TextEdit, but that app has on many occasions changed it default settings back from plain text format to RTF.
Thanks for the warning, I've never seen that. I did notice that my wife's new MBP (with Mojave macOS 10.14 preinstalled) came with the default set to RTF. [banghead]

You?re welcome, as you stated in your last post, this is Apple?s thinking of how it should work.

xairbusdriver

  • Storm
  • *****
  • Posts: 3126
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.15.7/WC 3.0.5
Re: realtime.txt 24 hr vs 12 format issue
« Reply #11 on: July 11, 2019, 04:56:17 PM »
Fortunately, "Preferences" can be changed by the user. You remember who that is, of course... even if Apple often seems forget... [banghead]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system