How to extract the URL from xml or any text file2019 Community Moderator Electionextract blocks of text from xml filefilter text xml fileHow to extract XML from a text fileextract blocks of text from xml file with a conditionExtract value from XMLExtract arbitrary XML from a text file using sedHow to extract a XML from log fileHow to extract data from XML FileHow to extract the XML from a log entry?extract xml tag value from the file to Variable

How to balance a monster modification (zombie)?

Why didn’t Eve recognize the little cockroach as a living organism?

Why does Surtur say that Thor is Asgard's doom?

Determine voltage drop over 10G resistors with cheap multimeter

Isn't the word "experience" wrongly used in this context?

Friend wants my recommendation but I don't want to

What (if any) is the reason to buy in small local stores?

Knife as defense against stray dogs

When did hardware antialiasing start being available?

Why doesn't the fusion process of the sun speed up?

Is this Pascal's Matrix?

"Marked down as someone wanting to sell shares." What does that mean?

Have the tides ever turned twice on any open problem?

Unfrosted light bulb

Hackerrank All Women's Codesprint 2019: Name the Product

Writing in a Christian voice

How can an organ that provides biological immortality be unable to regenerate?

Why is this tree refusing to shed its dead leaves?

Can a university suspend a student even when he has left university?

Homology of the fiber

How can a new country break out from a developed country without war?

Do native speakers use "ultima" and "proxima" frequently in spoken English?

Jem'Hadar, something strange about their life expectancy

Does convergence of polynomials imply that of its coefficients?



How to extract the URL from xml or any text file



2019 Community Moderator Electionextract blocks of text from xml filefilter text xml fileHow to extract XML from a text fileextract blocks of text from xml file with a conditionExtract value from XMLExtract arbitrary XML from a text file using sedHow to extract a XML from log fileHow to extract data from XML FileHow to extract the XML from a log entry?extract xml tag value from the file to Variable










0















My XML file;



<settings version="2">
<setting id="TimeShift" default="true">0</setting>
<setting id="Override" default="true">false</setting>
<setting id="Cache">true</setting>
<setting id="Path">/storage/</setting>
<setting id="PathType">0</setting>
<setting id="Url1">http://localhost:8080/main.php?value1=abcd-1234&value2=OqUy1cHm&type=post</setting>
<setting id="startNum">1</setting>
</settings>


I need to extract the variable URL value. I tried some sed and grep commands but don't get result. Which command should I use?










share|improve this question









New contributor




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
























    0















    My XML file;



    <settings version="2">
    <setting id="TimeShift" default="true">0</setting>
    <setting id="Override" default="true">false</setting>
    <setting id="Cache">true</setting>
    <setting id="Path">/storage/</setting>
    <setting id="PathType">0</setting>
    <setting id="Url1">http://localhost:8080/main.php?value1=abcd-1234&value2=OqUy1cHm&type=post</setting>
    <setting id="startNum">1</setting>
    </settings>


    I need to extract the variable URL value. I tried some sed and grep commands but don't get result. Which command should I use?










    share|improve this question









    New contributor




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






















      0












      0








      0








      My XML file;



      <settings version="2">
      <setting id="TimeShift" default="true">0</setting>
      <setting id="Override" default="true">false</setting>
      <setting id="Cache">true</setting>
      <setting id="Path">/storage/</setting>
      <setting id="PathType">0</setting>
      <setting id="Url1">http://localhost:8080/main.php?value1=abcd-1234&value2=OqUy1cHm&type=post</setting>
      <setting id="startNum">1</setting>
      </settings>


      I need to extract the variable URL value. I tried some sed and grep commands but don't get result. Which command should I use?










      share|improve this question









      New contributor




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












      My XML file;



      <settings version="2">
      <setting id="TimeShift" default="true">0</setting>
      <setting id="Override" default="true">false</setting>
      <setting id="Cache">true</setting>
      <setting id="Path">/storage/</setting>
      <setting id="PathType">0</setting>
      <setting id="Url1">http://localhost:8080/main.php?value1=abcd-1234&value2=OqUy1cHm&type=post</setting>
      <setting id="startNum">1</setting>
      </settings>


      I need to extract the variable URL value. I tried some sed and grep commands but don't get result. Which command should I use?







      sed grep xml






      share|improve this question









      New contributor




      Ali Haydar Doğan 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 question









      New contributor




      Ali Haydar Doğan 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 question




      share|improve this question








      edited 12 hours ago









      Kusalananda

      136k17257425




      136k17257425






      New contributor




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









      asked 12 hours ago









      Ali Haydar DoğanAli Haydar Doğan

      11




      11




      New contributor




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





      New contributor





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






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




















          1 Answer
          1






          active

          oldest

          votes


















          1














          Assuming that the URL is actually encoded properly (it isn't now, which would break some XML parsers; both & should be &amp;):



          $ xmlstarlet sel -t -v '/settings/setting[@id = "Url1"]' -nl file.xml
          http://localhost:8080/main.php?value1=abcd-1234&amp;value2=OqUy1cHm&amp;type=post


          This uses xmlstarlet to fetch the value for the /settings/setting document node whose id attribute is Url1.






          share|improve this answer























          • Thank you for this valuable information. You are right for (&) character. I did a manual copy-paste of the url for the example.

            – Ali Haydar Doğan
            7 hours ago










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          );



          );






          Ali Haydar Doğan is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507003%2fhow-to-extract-the-url-from-xml-or-any-text-file%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Assuming that the URL is actually encoded properly (it isn't now, which would break some XML parsers; both & should be &amp;):



          $ xmlstarlet sel -t -v '/settings/setting[@id = "Url1"]' -nl file.xml
          http://localhost:8080/main.php?value1=abcd-1234&amp;value2=OqUy1cHm&amp;type=post


          This uses xmlstarlet to fetch the value for the /settings/setting document node whose id attribute is Url1.






          share|improve this answer























          • Thank you for this valuable information. You are right for (&) character. I did a manual copy-paste of the url for the example.

            – Ali Haydar Doğan
            7 hours ago















          1














          Assuming that the URL is actually encoded properly (it isn't now, which would break some XML parsers; both & should be &amp;):



          $ xmlstarlet sel -t -v '/settings/setting[@id = "Url1"]' -nl file.xml
          http://localhost:8080/main.php?value1=abcd-1234&amp;value2=OqUy1cHm&amp;type=post


          This uses xmlstarlet to fetch the value for the /settings/setting document node whose id attribute is Url1.






          share|improve this answer























          • Thank you for this valuable information. You are right for (&) character. I did a manual copy-paste of the url for the example.

            – Ali Haydar Doğan
            7 hours ago













          1












          1








          1







          Assuming that the URL is actually encoded properly (it isn't now, which would break some XML parsers; both & should be &amp;):



          $ xmlstarlet sel -t -v '/settings/setting[@id = "Url1"]' -nl file.xml
          http://localhost:8080/main.php?value1=abcd-1234&amp;value2=OqUy1cHm&amp;type=post


          This uses xmlstarlet to fetch the value for the /settings/setting document node whose id attribute is Url1.






          share|improve this answer













          Assuming that the URL is actually encoded properly (it isn't now, which would break some XML parsers; both & should be &amp;):



          $ xmlstarlet sel -t -v '/settings/setting[@id = "Url1"]' -nl file.xml
          http://localhost:8080/main.php?value1=abcd-1234&amp;value2=OqUy1cHm&amp;type=post


          This uses xmlstarlet to fetch the value for the /settings/setting document node whose id attribute is Url1.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 12 hours ago









          KusalanandaKusalananda

          136k17257425




          136k17257425












          • Thank you for this valuable information. You are right for (&) character. I did a manual copy-paste of the url for the example.

            – Ali Haydar Doğan
            7 hours ago

















          • Thank you for this valuable information. You are right for (&) character. I did a manual copy-paste of the url for the example.

            – Ali Haydar Doğan
            7 hours ago
















          Thank you for this valuable information. You are right for (&) character. I did a manual copy-paste of the url for the example.

          – Ali Haydar Doğan
          7 hours ago





          Thank you for this valuable information. You are right for (&) character. I did a manual copy-paste of the url for the example.

          – Ali Haydar Doğan
          7 hours ago










          Ali Haydar Doğan is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Ali Haydar Doğan is a new contributor. Be nice, and check out our Code of Conduct.












          Ali Haydar Doğan is a new contributor. Be nice, and check out our Code of Conduct.











          Ali Haydar Doğan is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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%2funix.stackexchange.com%2fquestions%2f507003%2fhow-to-extract-the-url-from-xml-or-any-text-file%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

          getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

          Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

          Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.