Perl and Python have syntax options that are similar to the style of awk. The style was described to me as filter thinking. These were not tested on real data.<p>The awk program translates to<p>#!/usr/bin/perl<p>while (<>) {<p><pre><code> push @freq, (split)[2..-1] if /Frequencies/;
push @fc, (reverse(split))[3..-1] if /Frc consts/;
push @ir, (reverse(split))[3..-1] if /IR Inten/;
</code></pre>
}<p>print "@freq[$_ - 1] $fc[$_] $ir[$_]\n" for 1..@freq;<p>and in python<p>#!/usr/bin/env python3<p>import sys<p>freq = []<p>fc = []<p>ir = []<p>for line in sys.stdin:<p><pre><code> fields = line.split()
if "Frequencies" in line:
freq.extend(fields[2:])
elif "Frc consts" in line:
fc.extend(reversed(fields[3:]))
elif "IR Inten" in line:
ir.extend(reversed(fields[3:]))
</code></pre>
for i in range(len(freq)):<p><pre><code> print(freq[i], fc[i], ir[i])</code></pre>