1. S

    Creating a grouped tab separated file with a flat list

    Crosspost: Hello, This is my first post here and I'm hoping the community is inviting to novice shell scripters. So let me share. I have a text file with a list of values. Here is a snip...
  2. C

    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...
  3. 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...
  4. 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...
  5. ylspirit

    GNU sed syntax and sed examples
  6. 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...
  7. W

    Replacing multiple lines using Sed

    Hi, I'm following this tutorial: 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 =...