Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Adding solution from JS:</p> <pre><code>awk -F'&gt;' '/table name/{$NF="slonyid="q x++ q FS}1' q='"' inputFile </code></pre> <p>Try this:</p> <pre><code>awk -F'&gt;' '/table name/{print $(NF-1)" slonyid""=""\""NR-1"\"""&gt;"}' inputFile </code></pre> <p>Adding test:</p> <pre><code>$ cat temp.txt table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; table name="dbname.tablename" lots of text here&gt; $ awk -F'&gt;' '/table name/{print $(NF-1)" slonyid""=""\""NR-1"\"""&gt;"}' temp.txt table name="dbname.tablename" lots of text here slonyid="0"&gt; table name="dbname.tablename" lots of text here slonyid="1"&gt; table name="dbname.tablename" lots of text here slonyid="2"&gt; table name="dbname.tablename" lots of text here slonyid="3"&gt; table name="dbname.tablename" lots of text here slonyid="4"&gt; table name="dbname.tablename" lots of text here slonyid="5"&gt; table name="dbname.tablename" lots of text here slonyid="6"&gt; table name="dbname.tablename" lots of text here slonyid="7"&gt; table name="dbname.tablename" lots of text here slonyid="8"&gt; table name="dbname.tablename" lots of text here slonyid="9"&gt; table name="dbname.tablename" lots of text here slonyid="10"&gt; table name="dbname.tablename" lots of text here slonyid="11"&gt; table name="dbname.tablename" lots of text here slonyid="12"&gt; table name="dbname.tablename" lots of text here slonyid="13"&gt; table name="dbname.tablename" lots of text here slonyid="14"&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload