tag:blogger.com,1999:blog-1255024703457423340.post7345296695259990364..comments2024-03-13T13:54:48.044+05:30Comments on The UNIX School: sed - 10 examples to replace / delete / print lines of CSV fileGuru Prasadhttp://www.blogger.com/profile/07898245472802947101noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-1255024703457423340.post-280551077454661792019-12-28T00:36:50.210+05:302019-12-28T00:36:50.210+05:30Please try, if you want to delete 2nd field only t...Please try, if you want to delete 2nd field only then:<br /><br />sed 's/[^,]*,//2' fileAnonymoushttps://www.blogger.com/profile/09875980540495264376noreply@blogger.comtag:blogger.com,1999:blog-1255024703457423340.post-31828425592492815002017-05-31T17:20:15.669+05:302017-05-31T17:20:15.669+05:30i need to search for the word A&T_000_.pdf in...i need to search for the word A&T_000_.pdf in file insider folder i am tried find $search_basedir -type f | sed 's/[!@#\$%^&*()]//g' | xargs grep -y -i A&T_000_.pdf <br /><br />But not working .. it is possible to help<br />parthihttps://www.blogger.com/profile/13840642515770810864noreply@blogger.comtag:blogger.com,1999:blog-1255024703457423340.post-4119334257687485852016-03-04T22:28:08.005+05:302016-03-04T22:28:08.005+05:30awk is the way to go for this, not sed:
awk -F, &...awk is the way to go for this, not sed:<br /><br />awk -F, '$NF=="xyz"{$4="abc";}1' OFS=,Guru Prasadhttps://www.blogger.com/profile/07898245472802947101noreply@blogger.comtag:blogger.com,1999:blog-1255024703457423340.post-39018936906287751302016-02-28T00:22:58.523+05:302016-02-28T00:22:58.523+05:30Hi,
I need below answer
Replace the 4th field b...Hi,<br /><br /> I need below answer<br /><br />Replace the 4th field by abc if the last field matches 'xyz'<br /><br />Please help . what is the command. <br /><br /><br />00:10:E0:8B:2E:D6,default,none,x8664.abc329,kkm,none,1.0,none,defaultp1.0,xyz<br /><br />i have tried below command but no luck. <br /><br />sed -i 's/\(xyz\)\(,.*,\).*/\1\2x8664.OL60.u4/' masterfile.txt<br /><br />-Thanks<br /> Jaganjaganhttps://www.blogger.com/profile/01854098246867044763noreply@blogger.comtag:blogger.com,1999:blog-1255024703457423340.post-11078422569946679612014-04-08T08:41:13.030+05:302014-04-08T08:41:13.030+05:30Slightly improved or shorter versions of some:
6:...Slightly improved or shorter versions of some:<br /><br />6:<br />$ sed -n '/,[0-9]$/p' file<br />$ sed '/,[0-9]$/!d' file<br /><br />8:<br />sed '/^Ubuntu,/s/[^,]*$/99/'<br /><br />9: Similar to 8<br /><br />10:<br />sed 's/$/,A/' file<br /><br />11:<br />sed 's/^/A,/' fileAnonymoushttps://www.blogger.com/profile/05010690127472363640noreply@blogger.comtag:blogger.com,1999:blog-1255024703457423340.post-32452209257499600262013-09-11T10:04:17.647+05:302013-09-11T10:04:17.647+05:30Really Good collections!!for UNIX must be read!!Really Good collections!!for UNIX must be read!!Anonymoushttps://www.blogger.com/profile/08640668075819837903noreply@blogger.com