Author Topic: Omnibus Extender - CSV Update  (Read 778 times)

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Omnibus Extender - CSV Update
« on: May 02, 2022, 07:40:25 pm »
For any interested parties...I have updated/added some CSV functions in this Extender.

Added Load using CSV String.
Added Save to String.
Some feature updates to InsertRow/Column.
Some other unrelated tweaks.

http://www.jtdata.com/anonymous/wbomnibus.zip


Jim

kdmoyers

  • Sr. Member
  • ****
  • Posts: 487
Re: Omnibus Extender - CSV Update
« Reply #1 on: May 03, 2022, 06:58:55 am »
Thanks Jim!
The mind is everything; What you think, you become.

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #2 on: May 03, 2022, 11:13:08 am »
No problem.  Only took me a year or so to figure out why the Load from String wasn't working  :)

Jim

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #3 on: June 28, 2022, 03:10:36 pm »
I have posted another update.  I discovered a bug in the CSV library and the author just fixed it.   It was related to Removing columns when using column headers as index.

Also, I did a major revamp of the HTML Parsing.  I operated under the assumption that no one was using it so also made some breaking changes.  Mostly function name changes but any function that had a "Count" parameter no longer has that parameter.    I primarily made this assumption on the fact that it didn't really seem to work very well so figured I would have heard something.   If this is not true and this will create major problems for you, let me know.    I think it would be worth making the changes as this seems to work much better and, as a bonus, I believe works correctly.   Can't say that was true of the previous version.   Always surprised at how much testing I can do and then go to use something in production and it has glaring problems.

http://www.jtdata.com/anonymous/wbomnibus.zip


Jim

stanl

  • Pundit
  • *****
  • Posts: 1766
Re: Omnibus Extender - CSV Update
« Reply #4 on: June 29, 2022, 05:10:30 am »
Jim;


I'll try to test this out during long weekend. For .csv/.txt/.json I have been using Power Query and M-code which WB works with well. Just finished a script where PQ can calculate difference between 2 text Unix Timestamps and create an extra column for the duration in minutes from raw .csv data returned from web query. I'll see how the extender works with raw data.

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #5 on: June 29, 2022, 06:05:16 am »
Thanks.

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - Dialogs
« Reply #6 on: June 30, 2022, 07:57:18 am »
I added a few more functions to the Dialog section of the Extender.

   New - cbShowList()   Opens/Closes DropListBox.
   New - cbGetCount()  Count of Items in DropListBox.
   New - cbGetIndex()   Index of Specified Item in DropListBox.
   New - dbScrollTo()    Scroll to Item in DropListBox by Index.


I do take requests so if there is something that would be useful let  me know and I will see what I can do.

Jim

jmburton2001

  • Full Member
  • ***
  • Posts: 129
Re: Omnibus Extender - CSV Update
« Reply #7 on: June 30, 2022, 09:22:37 am »
Hi Jim!

The new dialog functions look very interesting. Are they included in the download at Reply #3?

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #8 on: June 30, 2022, 09:45:05 am »
I just posted that today so you will need to download again.   Sorry.  Should have been a bit clearer.

http://www.jtdata.com/anonymous/wbomnibus.zip


Jim

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #9 on: June 30, 2022, 10:22:45 am »
At the risk of being annoying...I just discovered that passing by Reference has once again come back to bite me.   Hopefully I covered all the bases this time.   This is one upside to me using what I write :)

http://www.jtdata.com/anonymous/wbomnibus.zip


Jim

stanl

  • Pundit
  • *****
  • Posts: 1766
Re: Omnibus Extender - CSV Update
« Reply #10 on: June 30, 2022, 10:53:09 am »
Jim,


I ran a few of the .csv functions and all worked as expected. However, being the ultimate goal of a .csv or .txt is Excel I find myself relying heavily on Power Query and it's transform functionality. For example, I have a an API call that returns unix dates which I transform to datetime and recalculate from PST to EST adding a duration field for minutes between times. This is accomplished with 6 lines of m-code [run as a query from WB]. But I keep your extender in the back-pocket as you never know. I think Tony needs to move your title up to Developer.

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #11 on: June 30, 2022, 11:20:31 am »
Appreciate the time and knowing that things are working.   

Yeah...no doubt there will always be some things done more easily other ways.

Thanks again.   The feedback is very helpful.

Jim

stanl

  • Pundit
  • *****
  • Posts: 1766
Re: Omnibus Extender - CSV Update
« Reply #12 on: July 01, 2022, 08:12:03 am »
2 more ++'s for your .csv functions. Both the get column name / column index have significance for some Hana processing I am doing [Hana is column-wise rather than row-wise, so order is important not just column name]. Also, since server Hana inputs can be set to NoHeader, I'm going to see if I can tweak your existing functions to recognize a .csv with or w/out header row.

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #13 on: July 01, 2022, 08:35:41 am »
Sounds good.   The CSV is quickly becoming one of my favorite parts of the extender.   As you are discovering, it makes manipulating data much easier and I often go this route now rather than messing with arrays.

Jim

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #14 on: February 16, 2023, 12:24:32 pm »
I have added a csvFilter() function to my Extender.   See Help file for details.   I think all is solid.  Did lots of testing but I am sure I didn't try every single combination and probably even missed something obvious but hopefully not.


http://www.jtdata.com/anonymous/wbomnibus.zip

Jim

bottomleypotts

  • Jr. Member
  • **
  • Posts: 84
Re: Omnibus Extender - CSV Update
« Reply #15 on: February 16, 2023, 10:34:28 pm »
Thanks Jim, as always much appreciated!

Agree that the CSV is a much more elegant way of handling data.

Quick question - have you made any progress on your SECURE Websocket funtionality?

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #16 on: February 17, 2023, 08:00:47 am »
I worked on that but, oddly enough, I cannot find ANY websocket service but my own that I can connect with for testing.  I just installed the standard stuff on a Windows Server and it worked fine.  Every test site I try fails.   Seems like it should work with either secure or unsecure, as it is but no way for me to test.   I think I had someone tell me it worked for them but not sure if that was secure or not and if they were connecting to my server or not.

Have you tried connecting either way?  Results?

Sorry I don't have anything more definite.

Plus, I keep hoping Tony will announce that as a new release for WinBatch and I can remove it from my Extender :)

Jim

bottomleypotts

  • Jr. Member
  • **
  • Posts: 84
Re: Omnibus Extender - CSV Update
« Reply #17 on: February 17, 2023, 08:47:23 am »
I have got it working with echo servers. And it works just as expected - perfectly! But that was an unsecured service!

I would like to use it to interact with Discord and Slack, rather than just using it as a messaging service. However their websockets service is only secure. I did not try connecting as you had said in the past it wasn't ready. (Just tried connecting to a secure echo service and it failed to connect.)

As always, thanks!

Agree, it would be nice if this was integrated into winbatch. I believe I asked for this in 2017. So I'm not holding my breath!

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #18 on: February 17, 2023, 02:22:07 pm »
Do you have a link to a service that worked for you?   I have tried a few but no luck.  Not sure why.

Jim

bottomleypotts

  • Jr. Member
  • **
  • Posts: 84
Re: Omnibus Extender - CSV Update
« Reply #19 on: February 17, 2023, 08:37:57 pm »
Here's the last code I played around with. One observation - no error message if something went wrong, the process just crashed. This would be a problem in real life, as I'd be expecting this to continuously poll.


Code: Winbatch
AddExtender(`wbOmnibus.dll`)

BoxOpen(`test`,``)

zUrl=`ws://echo.websocket.events/.ws`
zBT=``

zMessages=`this is a test,this works,wow,hello`

zWs=wsConnect(zUrl)

c=0

While @TRUE

        c=c+1
        BoxTitle(c)

        Ret=wsPoll()
        While Ret!=``
                zBT:=@CR:Ret
                BoxText(zBT)

                Ret=wsPoll()
        EndWhile

        r=Random(3)+1

        e=ItemExtract(r,zMessages,`,`)
        wsSend(c:` `:e)

        TimeDelay(c)

EndWhile

wsDisConnect()
 

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #20 on: February 18, 2023, 06:25:34 am »
Thank you.

Jim

JTaylor

  • Pundit
  • *****
  • Posts: 1907
    • Data & Stuff Inc.
Re: Omnibus Extender - CSV Update
« Reply #21 on: February 26, 2023, 09:05:11 pm »
Just to follow up on the secure WebSocket stuff.  Don't be holding your breath.   For obvious reasons this utilizes events.   That is not something that I can leverage in an Extender.   Add to that the need for openssl and asio libraries and it complicates things to a point where I don't think this will be feasible in an Extender, at least not utilizing the SDK.

Jim