Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add text start every line 1

Status
Not open for further replies.

cbsm

Programmer
Oct 3, 2002
229
FR
As you see with my question, I do not use unix script very often.
This is what i'd like to do :
I have a text file (.csv).
I want to add a few characters (";;;") at the start of each line :
test;abc;def
becomes
;;;test;abc;def

I tried different sorts of sed commands without any success.
for example sed -i "s/*/;;;*/g" myfile.csv > newfile.csv
I get the error "sed: illegal option --i"

Many thanks !
 
A hint: ^ in sed means 'beginning of the line',
and so try:

sed -e "s/^/;;;/" myfile.csv > newfile.csv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top