sed

  1. CrazedNerd

    Why I Love Sed and a Clear/Practical Beginner's Guide to Using It

    Since using linux, my favorite piece of software I have discovered so far is sed. Sed is a command line utility that stands for "stream editor". It was made based off the text editor named "ed", which is different from notepad, gedit, vim, or emacs. With ed, you create text files line by line...
  2. F

    Use sed for Mixed Case Tags

    I'm trying to reformat tags in an xlm file with using gnu sed on win10 (shoot me). I need to escape some windows command-line characters with ^. Sample line: <trn:description>V7906 03/11 ALFREDOCAMEL CHATSWOOD 74564500125</trn:description> I'm not totally clear what this line...
  3. P

    How can make a loop for sed in bash?

    Hi. I need help with loop for sed. I have the script: cat test1.txt | sed -n 1,3p | jq -Rn \ --arg v1 / \ --arg v3 server1 \ '[inputs] | map({"{#NAME}" : $v1, "{#LIST}": ., "{#MARK}": $v3}) | { "data": . }' cat test1.txt | sed -n 4,6p | jq -Rn \ --arg v1 / \ --arg...
  4. ylspirit

    GNU sed syntax and sed examples

    https://www.linuxcommands.site/linux-commands/gnu-sed-syntax-and-sed-examples/
  5. F

    Using Sed to replace some text and add test

    Hello, I have the following records in an LDIF file (actually, I have thousands of these records in the file): dn: cn=userA,ou=users,ou=vault,o=company changetype: modify add: attribute1 attr2: userA dn: cn=userB,ou=users,ou=vault,o=company changetype: modify add: attribute1 attr2: userB I...
  6. W

    Replacing multiple lines using Sed

    Hi, I'm following this tutorial: https://likegeeks.com/sed-linux/ and there is a section about replacing lines. Now, it works great, but my question is how to replace multiple lines like this: if (strlen($llcc) == 5) { $lang = substr(strtolower($llcc),0,2); $country =...
Top