lol. And that's why I couldn't figure it out.The format of the file would need to be something like
https://ninjatrader.com/support/helpGuides/nt8/?importing.htm#UnderstandingImportFileAndDataFormats
For example, I created the attached Grains.Last.txt with
I don't have NinjaTrader installed, so I just looked at the output.Code:cat Grains.txt | perl -n -e 'use warnings; use strict; our @mmDays; our $prevCl; BEGIN { @mmDays = qw/0 31 28 31 30 31 30 31 31 30 31 30 31/; } my $iline = $_; $iline =~ s/[",]//g; my ($mm, $yyyy, $hi, $lo, $cl) = $iline =~ qr#^(\d\d)/(\d\d\d\d)\s+(\S+)\s+(\S+)\s+(\S+)\s+$#; if ( !defined($cl) ) { next; } if ( ! defined($prevCl) ) { $prevCl = $cl; } print "$yyyy$mm$mmDays[$mm];$prevCl;$hi;$lo;$cl;0\n"; $prevCl = $cl;' > Grains.Last.txt