Changes

From SME Server
Jump to navigationJump to search
203 bytes removed ,  07:44, 4 February 2008
→‎newpo: thanks, maths tip used, was trying to escape instead of quote
Line 117: Line 117:  
   mv $1.bak $1
 
   mv $1.bak $1
 
   
 
   
  A=`cat $1 |grep entry |wc -l`
  −
  C=`expr $A / 2`
   
   B=`cat $1.po |grep msgid |wc -l`
 
   B=`cat $1.po |grep msgid |wc -l`
 +
  C=`cat $1 |grep '<entry>' |wc -l`
 
   D=`expr $B - 1`
 
   D=`expr $B - 1`
 
   E=`expr $B - $C`
 
   E=`expr $B - $C`
Line 142: Line 141:     
:I am wondering why we are using perl to replace as we can also use sed and if readability is not an issue we can do the whole CDATA tag conversin at once
 
:I am wondering why we are using perl to replace as we can also use sed and if readability is not an issue we can do the whole CDATA tag conversin at once
: <pre>sed -e 's/<!\[CDATA\[/STARTCDATA/g' -e 's/\]\]>/ENDCDATA/g' -e 's/\]\]>/ENDCDATA/g' -e 's/\]\]>/ENDCDATA/g' -e 's/\]\]>/ENDCDATA/g' < /path/to/orignal.file > /path/to/conversion.file</pre>
+
: <pre>sed -e 's/<!\[CDATA\[/STARTCDATA/g' -e 's/\]\]>/ENDCDATA/g' -e 's/\&>/AMP/g' < original.file > conversion.file</pre>
 
   
: And back
 
: And back
 +
: <pre>sed -e 's/STARTCDATA/<!\[CDATA\[/g' -e 's/ENDCDATA/\]\]>/g' -e 's/AMP/\&/g' < conversion.file > new.file</pre>
   −
: <pre>sed -e 's/STARTCDATA/<!\[CDATA\[/g' -e 's/ENDCDATA/\]\]>/g' -e 's/AMP/\&/g' < /path/to/conversion.file > /path/to/new.file</pre>
+
::yes but there are more conversions, so it was easier to operate on the one file, efficiency isn't a concern
 
  −
: On top off that I would retrieve the numeric value for C like this, which saves you some mathematics
  −
: <pre>C=`cat $1 |grep '<entry>' |wc -l`</pre>
  −
 
  −
: [[User:Cactus|Cactus]] 15:12, 3 February 2008 (MST)
      
====newpomerge====
 
====newpomerge====

Navigation menu