I have a file consisting of a single column of dollar amounts such as:
$172.83 $30.00 $74.36 $10.00 $528.33 $225.00 $107.78 $30.00 $74.36 $10.00 $61.85 $61.85 $18.70 $18.70 . . .
I need to transform this file into a file consisting of two columns with the second column taken from every other of the single-column numbers. How can I do that in TM2? I have looked in the manual and online for tips but can not find any that do what I want, or so it seems. Can you guys please suggest how to do this?
Thanks very much.
Comer
Hi Comer,
that's not really something you'd expect to be built in, but the hooks are there to apply pretty much any scripting language to get the job done: for example, using Perl.
(In Textmate)
Text => Filter through command...
perl -pe 's/\n/ / if ($.%2)'
This substitutes a space for the newline character at the end of the line if the line number ($.) is an odd number.
Cheers, Paul
This could be done using find/replace with a small regular expression:
2) Use the regular expression find pattern: ($.*)\n($.*)\n and replace pattern: $1\t$2\n