{"id":53,"date":"2012-03-08T00:56:40","date_gmt":"2012-03-08T00:56:40","guid":{"rendered":"http:\/\/www.dognmonkey.com\/ihp307x\/?p=53"},"modified":"2019-06-28T15:38:12","modified_gmt":"2019-06-28T22:38:12","slug":"find-and-replace-repeated-tolerance-in-analog-folder","status":"publish","type":"post","link":"https:\/\/www.dognmonkey.com\/ihp307x\/find-and-replace-repeated-tolerance-in-analog-folder.html","title":{"rendered":"Find And Replace Repeated Tolerance In Analog Folder"},"content":{"rendered":"<p style=\"text-align: center;\"><em>I always set tolerances for all passive components in the board file to 1% to make sure IPG generates all guarding possible. For testing stability, I change all resistors to 10% and capacitors to 20%. If a board has many components with the same values, chances are, the tolerance for these components are generated the same. After debugging the golden boards, many components may pass with 1% or less, but I still change them before deploying the fixture and program to CEM. It&#8217;s time consuming to go through every single component to change (which I do) the tolerance, but unix commands may help me to change them faster.<\/em><\/p>\n<p style=\"text-align: center;\"><em>To find components have the same tolerance in the analog folder, in the shell, I&#8217;m going to find all files with tolerance 2.09, 1.26 and output all the components to a file &#8220;110ohm.txt&#8221;<br \/>\n<\/em><\/p>\n<blockquote><p>cd analog<\/p>\n<p style=\"text-align: left;\"><em>find . -exec grep -l &#8216;2.09, 1.26&#8217; {} &gt; 110ohm.txt \\;<\/em><\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"find files output files to file\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Find Specific Tolerance\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile.jpg\" alt=\"find specific tolerance\" width=\"300\" height=\"222\" \/><\/a>\u00a0\u00a0\u00a0\u00a0 <a class=\"preview\" title=\"get file change tolerance compile\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile1.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Get file change tolerance\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile1.jpg\" alt=\"find replace compile\" width=\"300\" height=\"230\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Now we have the file with all components and we want to change all components with tolerance &#8216;2.09, 1.26&#8242; to &#8217;10, 10&#8217;<\/em><\/p>\n<blockquote>\n<p style=\"text-align: center;\"><em>for y in *<\/em><\/p>\n<p style=\"text-align: center;\"><em>do<\/em><\/p>\n<p style=\"text-align: center;\"><em>sed &#8220;s\/2.09, 1.26\/10, 10\/g&#8221; &#8220;$y&#8221; &gt; temp<\/em><\/p>\n<p style=\"text-align: center;\"><em>mv temp &#8220;$y&#8221;<\/em><\/p>\n<p style=\"text-align: center;\"><em>done<\/em><\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><em>it will go and replace all files with &#8216;2.09, 1.26&#8242; to &#8217;10, 10&#8217;<\/em><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"get text file\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile2.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Get the output file\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile2.jpg\" alt=\"Load the output file\" width=\"300\" height=\"228\" \/><\/a>\u00a0\u00a0\u00a0\u00a0 <a class=\"preview\" title=\"change content for compilation\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile3.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Change content to basic compliance \" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile3.jpg\" alt=\"change the file\" width=\"300\" height=\"227\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"change content for compilation\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile4.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Change content to basic compliance\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile4.jpg\" alt=\"change content\" width=\"300\" height=\"227\" \/><\/a>\u00a0\u00a0\u00a0\u00a0 <a class=\"preview\" title=\"change content for compilation\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile5.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Change content to basic compliance\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile5.jpg\" alt=\"change content\" width=\"300\" height=\"226\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"change content for compilation\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile6.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Change content to basic compliance\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile6.jpg\" alt=\"change content\" width=\"300\" height=\"230\" \/><\/a>\u00a0\u00a0\u00a0\u00a0 <a class=\"preview\" title=\"compile and done\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile7.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Get Basic File\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile7.jpg\" alt=\"get basic\" width=\"300\" height=\"228\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" title=\"compile and done\" href=\"\/media\/hp3070\/unixcmd\/find_replace_compile8.jpg\" rel=\"lightbox[uni]\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Compile and done\" src=\"\/media\/hp3070\/unixcmd\/tn_find_replace_compile8.jpg\" alt=\"Compile\" width=\"300\" height=\"234\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>When it&#8217;s done, check to see if the commands really work, load a file up to see if the tolerance had been changed to 10, 10. It should do it. Now we need to compile all these files. Load the list of the files up, make sure we&#8217;re at the main directory and NOT in analog directory as before, this time I use my basic window. Get the file from analog folder, but save it in the main folder.<\/em><\/p>\n<p style=\"text-align: center;\"><em>this screen shot is for a different file, but the idea is the same. Load the file from the main folder, we need to modify it to compile in basic.<\/em><\/p>\n<p style=\"text-align: center;\"><em>Make sure to have a space between the number and the quote.<\/em><\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" style=\"vertical-align: baseline; border: 3px solid black;\" title=\"Modify Text File with basic commands\" src=\"\/media\/hp3070\/unixcmd\/mod_tol_file1.jpg\" alt=\"mod file\" width=\"436\" height=\"281\" \/><\/p>\n<p style=\"text-align: center;\"><em>When all lines in the file are basic compliance &#8216;compile &#8220;analog\/rxx&#8221;, then we can &#8216;get basic &#8220;110ohm.txt&#8221;<\/em><\/p>\n<p style=\"text-align: center;\"><em>If we made mistake it will prompt, but if the basic is there, we&#8217;re safe to run, it will execute the compilation of all files in this basic window.<\/em><\/p>\n<p style=\"text-align: center;\"><em>So, it&#8217;s done for this exact tolerance modification.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><\/ul><\/p>\n<p style=\"text-align: center;\">\n","protected":false},"excerpt":{"rendered":"<p>I always set tolerances for all passive components in the board file to 1% to make sure IPG generates all guarding possible. For testing stability, I change all resistors to 10% and capacitors to 20%. If a board has many components with the same values, chances are, the tolerance for these components are generated the <a href=\"https:\/\/www.dognmonkey.com\/ihp307x\/find-and-replace-repeated-tolerance-in-analog-folder.html\" class=\"more-link\">&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[18],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-tips-and-tricks","tag-unix-commands"],"views":1767,"_links":{"self":[{"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":12,"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"predecessor-version":[{"id":334,"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/posts\/53\/revisions\/334"}],"wp:attachment":[{"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/ihp307x\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}