tag:blogger.com,1999:blog-2807403883562053852.post5346399309443851293..comments2024-03-27T08:40:31.785-06:00Comments on Clayton Cramer.: One More Request For Sed HelpClayton Cramerhttp://www.blogger.com/profile/03258083387204776812noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-2807403883562053852.post-87148532671032349032018-10-05T12:55:30.293-06:002018-10-05T12:55:30.293-06:00I think you've got some typos in your example,...I think you've got some typos in your example, but it looks like you don't want to use -E. (I will admit I probably don't know sed as well as you; I never used it a lot.)<br /><br />I eventually came up with this variation:<br />sed "s/[[:digit:]]\{4\}/0\/0\/&/" x.csv | sed "s=\([[:digit:]]\)/\([[:digit:]]\(4\)\)=\1/0/\2="<br /><br />With x.csv looking like this: 1,a,b,1234,1/1/1900, the above produced the following output: 1,a,b,0/0/1234,1/1/1900<br /><br />Note that the "invalid reference" went away when I stopped using -E.Rick Chttps://www.blogger.com/profile/10992428161064901136noreply@blogger.com