sed

  1. 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...
  2. 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...
  3. ylspirit

    GNU sed syntax and sed examples

    https://www.linuxcommands.site/linux-commands/gnu-sed-syntax-and-sed-examples/
  4. 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...
  5. 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