1

I'm looking for a tool/package (preferably in JavaScript or Python) that can access SED or perform the same functionality as SED tools.

In my case, I wanted to output specific text data from a file that is accessed via API calls. One solution was to use stream editor. However, I can't seem to find some way to programatically access Does anyone know of such a tool? Or can point me in the right direction?

Cody
  • 329
  • 4
  • 16
  • 1
    Having Python, why would you want sed? What does sed do that python doesn't? – DYZ Dec 10 '18 at 23:10
  • Can you say more about your use case? Which layer do you want to do the replacement - before the API call returns? Once the response is parsed? I agree that usually you wouldn't call `sed` from `python` or `js` because the capabilities are usually easier to program in those languages directly. – erik258 Dec 10 '18 at 23:11
  • Let me add some more context. This is building onto this question I asked a few days ago. I wanted to grab a specific text from GitHub README.md file from their API. The top answer was using stream editor to accomplish this task. However, I want to know if there is some programmatic way to achieve the same means. [Previous Question](https://stackoverflow.com/questions/53605718/get-specific-readme-md-data-from-github-api/53605890#53605890) – Cody Dec 10 '18 at 23:42

1 Answers1

0

sed(1) uses a general concept called Regular Expression, which you should read about. Both JavaScript and Python have built-in support for regular expression matching and substitution.

remram
  • 4,805
  • 1
  • 29
  • 42