Sed stands for Stream EDitor. It is one of the basic tools in the POSIX environment - it processes one or more files according to an editing script and writes the results to standard output. Created in Bell Labs, it has been around since mid-70s.

learn more… | top users | synonyms

1
vote
1answer
178 views

Bash Shell Script uses Sed to create and insert multiple lines after a particular line in an existing file

This code seems to work, but I'd like someone with shell-fu to review it. Is the temp file a good idea? How would I do without? Is sed the right tool? Any other general advice for improving my ...
0
votes
1answer
58 views

Parsing of a file using sed

I have a file containing lines having this structure : var marker25 = createMarker(point, '<div id="infowindow" style="white-space: nowrap;"><h3>Katz\'s Deli</h3>205 E. Houston ...
2
votes
2answers
144 views

Add getters and setters to a set of variables

Any improvements are welcome. a.bat sed -r "s/private (.*) (.*);(.*)/&\npublic \1 get\u\2(){return \2;}\npublic void set\u\2(\u\2){this.\2=\u\2;}\n/" "%~1">"%~2" in: private String ...
2
votes
3answers
349 views

Tiny bash script: Is sed necessary here?

I've recently discovered the power of sed; regular expressions seem like they'll take a lifetime to master. This tiny script uses both to add zero before the single digit in file names. Can this be ...
4
votes
1answer
269 views

Transpose a matrix using sed

Transpose the following data from: 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 ...