Reputation:
Please advice , how to tell sed to match exactly the number
for example ,
regarding the file.csv file we want to change the word STATUS to OK only on line that start with number 1 (before the "," seperator )
but sed replace the STATUS to OK also on LINE that start with 12
so how to change my sed syntax to match exactly the first number before the separator?
more file.csv
1,14556,43634,266,242,def,45,STATUS
12,4345,1,43,57,24,657,SD,STATUS
3,1,WQ,435,676,90,3,44f,STATUS
sed "/^1/ s/STATUS/OK/g" file.csv
1,14556,43634,266,242,def,45,OK
12,4345,1,43,57,24,657,SD,OK
3,1,WQ,435,676,90,3,44f,STATUS
Output should be as the following
sed ................. file.csv
1,14556,43634,266,242,def,45,OK
12,4345,1,43,57,24,657,SD,STATUS
3,1,WQ,435,676,90,3,44f,STATUS
Upvotes: 0
Views: 347