Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I looked in to doing this with Awk, but it looked like you wouldn't really get anything clever out of it, it would just be the same logic, but with some Awk pain to go with it, so I did it in Perl :)</p> <pre><code>#!/usr/bin/perl open(IN, $ARGV[0]) || die("Could not open file: " . $ARGV[0]); my $buffer=""; foreach $line (&lt;IN&gt;) { if ($line =~ /^check=/) { $flag = 1; $buffer .= $line; } elsif ($flag == 1 &amp;&amp; $line =~/\)/) { $flag = 0; $buffer .= $line; } elsif ($flag == 1) { $buffer .= $line; } elsif ($flag == 0 &amp;&amp; $line =~ /^files=/) { $flag = 2; print $line; } elsif ($flag == 2 &amp;&amp; $line =~ /\)/) { $flag = 0; print $line; if (length($buffer) &gt; 0) { print $buffer; $buffer = ""; } } else { print $line; } } </code></pre> <p>And the output :)</p> <pre><code>Chill:~ rus$ cat test check=('78905905f5a4ed82160c327f3fd34cba' '5277a9164001a4276837b59dade26af2' '3f8b60b6fbb993c18442b62ea661aa6b') text in between files=('somefile.txt' 'file2.png' 'another.txt' 'andanother...') asdasdasd check=('78905905f5a4ed82160c327f3fd34cba' '5277a9164001a4276837b59dade26af2' '3f8b60b6fbb993c18442b62ea661aa6b') text in between files=('somefile.txt' 'file2.png' 'another.txt' 'andanother...') asdsd check=('78905905f5a4ed82160c327f3fd34cba' '5277a9164001a4276837b59dade26af2' '3f8b60b6fbb993c18442b62ea661aa6b') text in between files=('somefile.txt' 'file2.png' 'another.txt' 'andanother...') Chill:~ rus$ ./t.pl test text in between files=('somefile.txt' 'file2.png' 'another.txt' 'andanother...') check=('78905905f5a4ed82160c327f3fd34cba' '5277a9164001a4276837b59dade26af2' '3f8b60b6fbb993c18442b62ea661aa6b') asdasdasd text in between files=('somefile.txt' 'file2.png' 'another.txt' 'andanother...') check=('78905905f5a4ed82160c327f3fd34cba' '5277a9164001a4276837b59dade26af2' '3f8b60b6fbb993c18442b62ea661aa6b') asdsd text in between files=('somefile.txt' 'file2.png' 'another.txt' 'andanother...') check=('78905905f5a4ed82160c327f3fd34cba' '5277a9164001a4276837b59dade26af2' '3f8b60b6fbb993c18442b62ea661aa6b') </code></pre> <p>ta da ?! :D</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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