title: Bash command to convert varying fields from hex to decimal
body: <p>I have a text file with the sample lines below:</p>
  
  <pre><code>40,1,1a,0002,0001,,1234;5678;,027e;0280;
  50,1,1a,0001,0004,,,0890;
  </code></pre>
  
  <p>I want to convert items separated by comma or semicolon from hex to decimal but only for the fields to the right of the 2nd field. First and second fields from the left are already in decimal. The number of field varies.</p>
  
  <p>I want to write a command in bash to convert above file to below:</p>
  
  <pre><code>40,1,26,2,1,,4660;22136;,638;640;
  50,1,26,1,4,,,2192;
  </code></pre>
  
  <p>How can I achieve this? I tried searching for an answer for some time but I really couldn't find the one that works.</p>