Project

General

Profile

Feature #643

Using Sed To Add Spaces To The Beginning Of Each Line Of A File

Added by Daniel Curtis over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Shell Scripts
Target version:
Start date:
08/25/2015
Due date:
% Done:

100%

Estimated time:
0.10 h
Spent time:

Description

This is a super simple way of adding a number of spaces to the beginning of each line of a given file.

  • Add 3 spaces to the beginning of every line of a file:
    sed -i -e 's/^/   /' example-file.txt
    

Resources

Also available in: Atom PDF