Adding/Removing from String kdb2019 Community Moderator ElectionHTTP GET request to KDB+ Process using AngularJSHow to correctly enum and partition a kdb table?kdb how to remove string key from dictionaryqpython.sync() is returning a QProjection instead of the queried dataKDB split by fixed delimiterRemove part of string KDBApply var to the last n numbers of a column in a tableIdentify N maxes of a row, discarding the remaining bottom values from table rowsAddiing rows from from one dataset to another based on certain conditions when all columns name don't match in kdb+KDB: String comparison with a table

How to disable or uninstall iTunes under High Sierra without disabling SIP

Sometimes a banana is just a banana

Specific Chinese carabiner QA?

Make me a metasequence

Why is it "take a leak?"

How to fix my table, centering of columns

When to use mean vs median

What is the meaning of "notice to quit at once" and "Lotty points”

Plagiarism of code by other PhD student

How to get the first element while continue streaming?

How to merge row in the first column in LaTeX

Can a Trickery Domain cleric cast a spell through the Invoke Duplicity clone while inside a Forcecage?

Should I use HTTPS on a domain that will only be used for redirection?

Are all UTXOs locked by an address spent in a transaction?

Is every open circuit a capacitor?

Why would the IRS ask for birth certificates or even audit a small tax return?

Is divide-by-zero a security vulnerability?

Difference between 'stomach' and 'uterus'

Is there a frame of reference in which I was born before I was conceived?

is 'sed' thread safe

A peculiar integral identity

How to mitigate "bandwagon attacking" from players?

How does insurance birth control work?

Ahoy, Ye Traveler!



Adding/Removing from String kdb



2019 Community Moderator ElectionHTTP GET request to KDB+ Process using AngularJSHow to correctly enum and partition a kdb table?kdb how to remove string key from dictionaryqpython.sync() is returning a QProjection instead of the queried dataKDB split by fixed delimiterRemove part of string KDBApply var to the last n numbers of a column in a tableIdentify N maxes of a row, discarding the remaining bottom values from table rowsAddiing rows from from one dataset to another based on certain conditions when all columns name don't match in kdb+KDB: String comparison with a table










0















I was doing some work to do with kdb and have been tinkering with strings and variables. I was just wondering if its possible to remove part of a string and add something to do the end of it.



s1:"Hello" s2:" World"


I have a joint string "Hello World" which I created using



s3:s1,s2


I was trying to remove the Hello and add something after the World in the joint string.



s3[1*til 6] = Hello


This allows me to select the Hello part of the string if this helps










share|improve this question
























  • What solution did you try? You are already using comma to create s3 then you could use same for your other requirement. Instead of simply asking for answer, please also post your solution that you have tried.

    – Rahul
    15 hours ago







  • 1





    s3[1*til 6],"Of Warcraft" is what I had tried

    – Aaron91204
    15 hours ago











  • Cool. Try to mention your approach as well in your question that will help others to identify the root cause and to see where you are going wrong.

    – Rahul
    14 hours ago
















0















I was doing some work to do with kdb and have been tinkering with strings and variables. I was just wondering if its possible to remove part of a string and add something to do the end of it.



s1:"Hello" s2:" World"


I have a joint string "Hello World" which I created using



s3:s1,s2


I was trying to remove the Hello and add something after the World in the joint string.



s3[1*til 6] = Hello


This allows me to select the Hello part of the string if this helps










share|improve this question
























  • What solution did you try? You are already using comma to create s3 then you could use same for your other requirement. Instead of simply asking for answer, please also post your solution that you have tried.

    – Rahul
    15 hours ago







  • 1





    s3[1*til 6],"Of Warcraft" is what I had tried

    – Aaron91204
    15 hours ago











  • Cool. Try to mention your approach as well in your question that will help others to identify the root cause and to see where you are going wrong.

    – Rahul
    14 hours ago














0












0








0








I was doing some work to do with kdb and have been tinkering with strings and variables. I was just wondering if its possible to remove part of a string and add something to do the end of it.



s1:"Hello" s2:" World"


I have a joint string "Hello World" which I created using



s3:s1,s2


I was trying to remove the Hello and add something after the World in the joint string.



s3[1*til 6] = Hello


This allows me to select the Hello part of the string if this helps










share|improve this question
















I was doing some work to do with kdb and have been tinkering with strings and variables. I was just wondering if its possible to remove part of a string and add something to do the end of it.



s1:"Hello" s2:" World"


I have a joint string "Hello World" which I created using



s3:s1,s2


I was trying to remove the Hello and add something after the World in the joint string.



s3[1*til 6] = Hello


This allows me to select the Hello part of the string if this helps







kdb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 15 hours ago









Jonathon McMurray

1,875319




1,875319










asked 15 hours ago









Aaron91204Aaron91204

114




114












  • What solution did you try? You are already using comma to create s3 then you could use same for your other requirement. Instead of simply asking for answer, please also post your solution that you have tried.

    – Rahul
    15 hours ago







  • 1





    s3[1*til 6],"Of Warcraft" is what I had tried

    – Aaron91204
    15 hours ago











  • Cool. Try to mention your approach as well in your question that will help others to identify the root cause and to see where you are going wrong.

    – Rahul
    14 hours ago


















  • What solution did you try? You are already using comma to create s3 then you could use same for your other requirement. Instead of simply asking for answer, please also post your solution that you have tried.

    – Rahul
    15 hours ago







  • 1





    s3[1*til 6],"Of Warcraft" is what I had tried

    – Aaron91204
    15 hours ago











  • Cool. Try to mention your approach as well in your question that will help others to identify the root cause and to see where you are going wrong.

    – Rahul
    14 hours ago

















What solution did you try? You are already using comma to create s3 then you could use same for your other requirement. Instead of simply asking for answer, please also post your solution that you have tried.

– Rahul
15 hours ago






What solution did you try? You are already using comma to create s3 then you could use same for your other requirement. Instead of simply asking for answer, please also post your solution that you have tried.

– Rahul
15 hours ago





1




1





s3[1*til 6],"Of Warcraft" is what I had tried

– Aaron91204
15 hours ago





s3[1*til 6],"Of Warcraft" is what I had tried

– Aaron91204
15 hours ago













Cool. Try to mention your approach as well in your question that will help others to identify the root cause and to see where you are going wrong.

– Rahul
14 hours ago






Cool. Try to mention your approach as well in your question that will help others to identify the root cause and to see where you are going wrong.

– Rahul
14 hours ago













3 Answers
3






active

oldest

votes


















4














you could use drop (_) to get rid of the "Hello" and join (,) to add on what you want. Something like



q)6_s3,"star Hiphop"
"Worldstar Hiphop"


If you didn't want to count the letters in the first word you could use vector from scalar (vs) to get a list of enlisted words and index into it, then join onto that:



q)(" " vs s3)[1],"star Hiphop"
"Worldstar Hiphop"


Hope this helps.






share|improve this answer










New contributor




Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    4














    Strings are character lists, so the drop function _ will still work on them. For example 1_"Hello" will return ello.



    So if you want to remove "Hello" from your string s3 you would use



    q)5_s3
    "World"


    Adding something onto the end of this then requires the join operator ,, for example



    q)s:"HelloWorld"
    q)s1:"Mr. "
    q)s2:5_s
    q)s3:"wide"
    q)s1,s2,s3
    "Mr. Worldwide"





    share|improve this answer






























      2














      You could use the ssr function (string search replace).



      q)s3:"HelloWorld"

      q)ssr[s3;"Hello";""], " of War"
      "World of War"





      share|improve this answer










      New contributor




      Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



















        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021244%2fadding-removing-from-string-kdb%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        4














        you could use drop (_) to get rid of the "Hello" and join (,) to add on what you want. Something like



        q)6_s3,"star Hiphop"
        "Worldstar Hiphop"


        If you didn't want to count the letters in the first word you could use vector from scalar (vs) to get a list of enlisted words and index into it, then join onto that:



        q)(" " vs s3)[1],"star Hiphop"
        "Worldstar Hiphop"


        Hope this helps.






        share|improve this answer










        New contributor




        Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.
























          4














          you could use drop (_) to get rid of the "Hello" and join (,) to add on what you want. Something like



          q)6_s3,"star Hiphop"
          "Worldstar Hiphop"


          If you didn't want to count the letters in the first word you could use vector from scalar (vs) to get a list of enlisted words and index into it, then join onto that:



          q)(" " vs s3)[1],"star Hiphop"
          "Worldstar Hiphop"


          Hope this helps.






          share|improve this answer










          New contributor




          Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






















            4












            4








            4







            you could use drop (_) to get rid of the "Hello" and join (,) to add on what you want. Something like



            q)6_s3,"star Hiphop"
            "Worldstar Hiphop"


            If you didn't want to count the letters in the first word you could use vector from scalar (vs) to get a list of enlisted words and index into it, then join onto that:



            q)(" " vs s3)[1],"star Hiphop"
            "Worldstar Hiphop"


            Hope this helps.






            share|improve this answer










            New contributor




            Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.










            you could use drop (_) to get rid of the "Hello" and join (,) to add on what you want. Something like



            q)6_s3,"star Hiphop"
            "Worldstar Hiphop"


            If you didn't want to count the letters in the first word you could use vector from scalar (vs) to get a list of enlisted words and index into it, then join onto that:



            q)(" " vs s3)[1],"star Hiphop"
            "Worldstar Hiphop"


            Hope this helps.







            share|improve this answer










            New contributor




            Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer








            edited 15 hours ago





















            New contributor




            Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 15 hours ago









            SamSam

            562




            562




            New contributor




            Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.























                4














                Strings are character lists, so the drop function _ will still work on them. For example 1_"Hello" will return ello.



                So if you want to remove "Hello" from your string s3 you would use



                q)5_s3
                "World"


                Adding something onto the end of this then requires the join operator ,, for example



                q)s:"HelloWorld"
                q)s1:"Mr. "
                q)s2:5_s
                q)s3:"wide"
                q)s1,s2,s3
                "Mr. Worldwide"





                share|improve this answer



























                  4














                  Strings are character lists, so the drop function _ will still work on them. For example 1_"Hello" will return ello.



                  So if you want to remove "Hello" from your string s3 you would use



                  q)5_s3
                  "World"


                  Adding something onto the end of this then requires the join operator ,, for example



                  q)s:"HelloWorld"
                  q)s1:"Mr. "
                  q)s2:5_s
                  q)s3:"wide"
                  q)s1,s2,s3
                  "Mr. Worldwide"





                  share|improve this answer

























                    4












                    4








                    4







                    Strings are character lists, so the drop function _ will still work on them. For example 1_"Hello" will return ello.



                    So if you want to remove "Hello" from your string s3 you would use



                    q)5_s3
                    "World"


                    Adding something onto the end of this then requires the join operator ,, for example



                    q)s:"HelloWorld"
                    q)s1:"Mr. "
                    q)s2:5_s
                    q)s3:"wide"
                    q)s1,s2,s3
                    "Mr. Worldwide"





                    share|improve this answer













                    Strings are character lists, so the drop function _ will still work on them. For example 1_"Hello" will return ello.



                    So if you want to remove "Hello" from your string s3 you would use



                    q)5_s3
                    "World"


                    Adding something onto the end of this then requires the join operator ,, for example



                    q)s:"HelloWorld"
                    q)s1:"Mr. "
                    q)s2:5_s
                    q)s3:"wide"
                    q)s1,s2,s3
                    "Mr. Worldwide"






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 15 hours ago









                    rmorganrmorgan

                    1014




                    1014





















                        2














                        You could use the ssr function (string search replace).



                        q)s3:"HelloWorld"

                        q)ssr[s3;"Hello";""], " of War"
                        "World of War"





                        share|improve this answer










                        New contributor




                        Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.
























                          2














                          You could use the ssr function (string search replace).



                          q)s3:"HelloWorld"

                          q)ssr[s3;"Hello";""], " of War"
                          "World of War"





                          share|improve this answer










                          New contributor




                          Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






















                            2












                            2








                            2







                            You could use the ssr function (string search replace).



                            q)s3:"HelloWorld"

                            q)ssr[s3;"Hello";""], " of War"
                            "World of War"





                            share|improve this answer










                            New contributor




                            Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.










                            You could use the ssr function (string search replace).



                            q)s3:"HelloWorld"

                            q)ssr[s3;"Hello";""], " of War"
                            "World of War"






                            share|improve this answer










                            New contributor




                            Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            share|improve this answer



                            share|improve this answer








                            edited 13 hours ago





















                            New contributor




                            Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            answered 14 hours ago









                            Shannon O'NeillShannon O'Neill

                            312




                            312




                            New contributor




                            Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.





                            New contributor





                            Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






                            Shannon O'Neill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021244%2fadding-removing-from-string-kdb%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                                Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                                Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved