john_spiral
November 25th, 2009, 11:46 AM
Hi,
I've got my head round the basics of sed but I'm stumped for a solution on the below problem.
I would like sed to replace the beginning of the colored lines with two commas. In effect sed will be searching for a sequence of lines starting with specific characters.
A picture is worth a thousand words...
Before
./path/to/file/xyz
File is on a network share.
Network Share name = \\server\path\
Path = unique_value
./path/to/file/abc
File is on a network share.
Network Share name = \\server\path\
Path = more path info
Path = more path info
Path = more path info
./path/to/file/efg
File is on a network share.
Network Share name = \\server\path\
Path = more path info
Path = more path info
./path/to/file/lmn
File is on a network share.
Network Share name = \\server\path\
Path = more path info
After
, ,./path/to/file/xyz
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = unique_value
, ,./path/to/file/abc
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = more path info
Path = more path info
Path = more path info
, ,./path/to/file/efg
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = more path info
Path = more path info
, ,./path/to/file/lmn
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = more path info
any help will be greatly appreciated.
I've got my head round the basics of sed but I'm stumped for a solution on the below problem.
I would like sed to replace the beginning of the colored lines with two commas. In effect sed will be searching for a sequence of lines starting with specific characters.
A picture is worth a thousand words...
Before
./path/to/file/xyz
File is on a network share.
Network Share name = \\server\path\
Path = unique_value
./path/to/file/abc
File is on a network share.
Network Share name = \\server\path\
Path = more path info
Path = more path info
Path = more path info
./path/to/file/efg
File is on a network share.
Network Share name = \\server\path\
Path = more path info
Path = more path info
./path/to/file/lmn
File is on a network share.
Network Share name = \\server\path\
Path = more path info
After
, ,./path/to/file/xyz
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = unique_value
, ,./path/to/file/abc
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = more path info
Path = more path info
Path = more path info
, ,./path/to/file/efg
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = more path info
Path = more path info
, ,./path/to/file/lmn
, ,File is on a network share.
, ,Network Share name = \\server\path\
, ,Path = more path info
any help will be greatly appreciated.