Hi,

I'm wondering what could cause this type of runtime error:

My program basically reads data from different kinds of data files, either a minute data file or a 5 minute data file and then does some analysis. When I run the program on the 1 min data, no problem. BUt when I run it on the 5 min data, I get a runtime error message/assertion failure that says:

Line 163
**
Expression: ("_Myptr + _Off <= ((Myvec* this->_Getmycont()))->_Mylast &&_Myptr + _Off>= etc**

Line 163 simply states:

163     std::vector<SwingIdentified>::iterator SwingIter; 
164 for (SwingIter= NamedSwings.begin(); SwingIter!=NamedSwings.end(); SwingIter++) 
165 {   
166     outfile << NamedSwings << std::endl;
    }

Any idea why the compiler would spit this out when I run the 5 min data file and not the 1 min data file? I tried rebooting my PC and tried looking into the data files to see if there were any glaring problems with the 5 min compared to the 1 min but can't tell of any.

Thanks,
TR

Perhaps the longer data file is too long to handle?

Try splitting it up into 1/2's and see if each 1/2, by itself, processes ok?

Is you output file looking correct for the smaller file that you said seems to run ok?

I would have thought your code would be more like this:

std::vector<SwingIdentified>::iterator SwingIter;

for (SwingIter= NamedSwings.begin(); SwingIter!=
NamedSwings.end(); SwingIter++)
outfile << *NamedSwings << std::endl;

Edited 1 Year Ago by David W

Hi David,

Thanks much for your thoughts. Well, both files are small samples, covering a few days worth of data only. I tried the indirection above but that caused a compile error, so it's not the code above.

I'm attaching the two files below

Edited 1 Year Ago by toneranger

Attachments
NQ05MIG	5	9/9/2010	930	1896.25	1897.75	1891.5	1894.75	11828	1893.25
NQ05MIG	5	9/9/2010	935	1894.5	1896	1892.75	1895.75	4951	1894.25
NQ05MIG	5	9/9/2010	940	1896	1896	1892	1893.75	4062	1892.25
NQ05MIG	5	9/9/2010	945	1894	1894.75	1890.5	1890.5	3252	1889
NQ05MIG	5	9/9/2010	950	1890.5	1893.5	1890	1892.5	2575	1891
NQ05MIG	5	9/9/2010	955	1893	1893.75	1891.5	1893	1800	1891.5
NQ05MIG	5	9/9/2010	1000	1893	1894.75	1891.5	1894.5	2444	1893
NQ05MIG	5	9/9/2010	1005	1894.25	1895.75	1892.25	1892.75	3127	1891.25
NQ05MIG	5	9/9/2010	1010	1892.75	1894.5	1892	1893.5	4636	1892
NQ05MIG	5	9/9/2010	1015	1893.75	1895	1890.5	1892.5	3271	1891
NQ05MIG	5	9/9/2010	1020	1892.5	1894	1892	1893	1183	1891.5
NQ05MIG	5	9/9/2010	1025	1893.25	1893.5	1891.25	1893.5	1418	1892
NQ05MIG	5	9/9/2010	1030	1893.5	1893.75	1889.5	1890	1919	1888.5
NQ05MIG	5	9/9/2010	1035	1889.75	1891.25	1888.25	1890.75	2632	1889.25
NQ05MIG	5	9/9/2010	1040	1891	1891.25	1889.75	1890	1371	1888.5
NQ05MIG	5	9/9/2010	1045	1890	1892.5	1890	1891.5	1157	1890
NQ05MIG	5	9/9/2010	1050	1891.5	1892.25	1888.5	1889	1410	1887.5
NQ05MIG	5	9/9/2010	1055	1889	1890.75	1887.25	1887.25	1549	1885.75
NQ05MIG	5	9/9/2010	1100	1887.5	1891	1887.5	1889.75	1555	1888.25
NQ05MIG	5	9/9/2010	1105	1889.75	1890.75	1888.75	1889.75	1008	1888.25
NQ05MIG	5	9/9/2010	1110	1890	1893	1890	1892	2429	1890.5
NQ05MIG	5	9/9/2010	1115	1892	1893.25	1891.75	1892.5	1192	1891
NQ05MIG	5	9/9/2010	1120	1892.5	1893.75	1892.25	1893.25	759	1891.75
NQ05MIG	5	9/9/2010	1125	1893.25	1895	1893.25	1894.5	974	1893
NQ05MIG	5	9/9/2010	1130	1894.5	1896.25	1893.25	1896	2059	1894.5
NQ05MIG	5	9/9/2010	1135	1895.75	1896.25	1895	1895.25	1150	1893.75
NQ05MIG	5	9/9/2010	1140	1895.5	1896.25	1895.25	1896	611	1894.5
NQ05MIG	5	9/9/2010	1145	1896.25	1896.25	1895.25	1895.5	888	1894
NQ05MIG	5	9/9/2010	1150	1895.75	1896.75	1894.5	1895	1942	1893.5
NQ05MIG	5	9/9/2010	1155	1895.25	1895.25	1894.25	1894.75	594	1893.25
NQ05MIG	5	9/9/2010	1200	1895	1896.25	1894.5	1895.5	1365	1894
NQ05MIG	5	9/9/2010	1205	1895.5	1895.5	1894.5	1894.75	959	1893.25
NQ05MIG	5	9/9/2010	1210	1895	1895.75	1894.25	1895	825	1893.5
NQ05MIG	5	9/9/2010	1215	1895	1895.5	1894.5	1894.5	437	1893
NQ05MIG	5	9/9/2010	1220	1894.75	1895.75	1894.75	1895.25	526	1893.75
NQ05MIG	5	9/9/2010	1225	1895.5	1895.75	1894.75	1895.25	736	1893.75
NQ05MIG	5	9/9/2010	1230	1895	1896	1895	1895.75	292	1894.25
NQ05MIG	5	9/9/2010	1235	1895.75	1896.75	1895	1896.25	768	1894.75
NQ05MIG	5	9/9/2010	1240	1896.75	1897.25	1896.25	1896.5	655	1895
NQ05MIG	5	9/9/2010	1245	1896.5	1896.5	1894	1894.25	2259	1892.75
NQ05MIG	5	9/9/2010	1250	1894.5	1895.25	1893.5	1894.5	1984	1893
NQ05MIG	5	9/9/2010	1255	1894.5	1894.75	1891.25	1891.25	3147	1889.75
NQ05MIG	5	9/9/2010	1300	1891.25	1893	1890.25	1892.75	2653	1891.25
NQ05MIG	5	9/9/2010	1305	1892.5	1893	1889.25	1889.25	2709	1887.75
NQ05MIG	5	9/9/2010	1310	1889.25	1889.75	1886.5	1887	3186	1885.5
NQ05MIG	5	9/9/2010	1315	1887	1889.75	1886.75	1889.25	2911	1887.75
NQ05MIG	5	9/9/2010	1320	1889.5	1890.75	1889.25	1890	1813	1888.5
NQ05MIG	5	9/9/2010	1325	1890	1890.25	1887	1887	1219	1885.5
NQ05MIG	5	9/9/2010	1330	1887	1887.5	1884.75	1887	3208	1885.5
NQ05MIG	5	9/9/2010	1335	1887.25	1889	1886.75	1888.25	1858	1886.75
NQ05MIG	5	9/9/2010	1340	1888.5	1888.5	1887.5	1888	786	1886.5
NQ05MIG	5	9/9/2010	1345	1888	1889.75	1886	1889.75	1540	1888.25
NQ05MIG	5	9/9/2010	1350	1890	1890.25	1888.5	1889	707	1887.5
NQ05MIG	5	9/9/2010	1355	1888.75	1889	1884.25	1885.5	2233	1884
NQ05MIG	5	9/9/2010	1400	1885.5	1887.75	1885.5	1887.5	936	1886
NQ05MIG	5	9/9/2010	1405	1887.75	1887.75	1885	1885.75	624	1884.25
NQ05MIG	5	9/9/2010	1410	1885.75	1885.75	1883.5	1885.5	1595	1884
NQ05MIG	5	9/9/2010	1415	1885.5	1885.5	1882.75	1884.25	1651	1882.75
NQ05MIG	5	9/9/2010	1420	1884	1885	1884	1884.25	612	1882.75
NQ05MIG	5	9/9/2010	1425	1884.25	1886.5	1883	1885	1729	1883.5
NQ05MIG	5	9/9/2010	1430	1884.75	1887.25	1884.5	1887.25	826	1885.75
NQ05MIG	5	9/9/2010	1435	1887.5	1888.5	1886.25	1886.75	1583	1885.25
NQ05MIG	5	9/9/2010	1440	1887	1887.5	1885.5	1886.75	990	1885.25
NQ05MIG	5	9/9/2010	1445	1886.75	1888.5	1886.25	1888.5	889	1887
NQ05MIG	5	9/9/2010	1450	1888.25	1888.75	1887.5	1887.75	1050	1886.25
NQ05MIG	5	9/9/2010	1455	1887.75	1890.5	1887	1890	1108	1888.5
NQ05MIG	5	9/9/2010	1500	1890	1890.5	1889.5	1890.5	860	1889
NQ05MIG	5	9/9/2010	1505	1890.5	1891.5	1889.5	1889.75	989	1888.25
NQ05MIG	5	9/9/2010	1510	1889.75	1890.25	1888.75	1889	783	1887.5
NQ05MIG	5	9/9/2010	1515	1889	1891.25	1889	1890.25	1102	1888.75
NQ05MIG	5	9/9/2010	1520	1890.5	1891.5	1889.75	1891.5	1423	1890
NQ05MIG	5	9/9/2010	1525	1891.5	1891.75	1890	1891	1522	1889.5
NQ05MIG	5	9/9/2010	1530	1890.75	1891.75	1890.25	1891.25	994	1889.75
NQ05MIG	5	9/9/2010	1535	1891.25	1893.25	1890.5	1892.75	1473	1891.25
NQ05MIG	5	9/9/2010	1540	1892.75	1893	1889.75	1890	1261	1888.5
NQ05MIG	5	9/9/2010	1545	1890.25	1890.5	1889	1889.5	1842	1888
NQ05MIG	5	9/9/2010	1550	1889.25	1889.25	1886.25	1886.5	2143	1885
NQ05MIG	5	9/9/2010	1555	1886.75	1887.5	1885.5	1887.25	6768	1885.75
NQ05MIG	5	9/9/2010	1600	1887	1891	1887	1889.5	3869	1888
NQ05MIG	5	9/10/2010	930	1886.75	1888	1882.25	1882.5	7038	1881
NQ05MIG	5	9/10/2010	935	1882.5	1884	1880.25	1881	6810	1879.5
NQ05MIG	5	9/10/2010	940	1880.75	1884	1880.25	1882.25	5803	1880.75
NQ05MIG	5	9/10/2010	945	1882.25	1886.5	1881.25	1886.5	5342	1885
NQ05MIG	5	9/10/2010	950	1886.5	1891	1886.25	1889.25	7573	1887.75
NQ05MIG	5	9/10/2010	955	1889.25	1892.5	1887.75	1888.25	4626	1886.75
NQ05MIG	5	9/10/2010	1000	1888.25	1888.5	1885.5	1888.25	3298	1886.75
NQ05MIG	5	9/10/2010	1005	1888	1888	1884.5	1887	3695	1885.5
NQ05MIG	5	9/10/2010	1010	1887	1890	1885.5	1888.5	4129	1887
NQ05MIG	5	9/10/2010	1015	1888.75	1889.5	1887	1889.5	3331	1888
NQ05MIG	5	9/10/2010	1020	1889.5	1892.5	1889.5	1891.5	4076	1890
NQ05MIG	5	9/10/2010	1025	1891.75	1891.75	1889.5	1890.75	1975	1889.25
NQ05MIG	5	9/10/2010	1030	1890.75	1894.25	1890.25	1892	4193	1890.5
NQ05MIG	5	9/10/2010	1035	1892	1892.75	1891	1891.75	1913	1890.25
NQ05MIG	5	9/10/2010	1040	1891.5	1891.75	1889.5	1890.75	2453	1889.25
NQ05MIG	5	9/10/2010	1045	1890.75	1890.75	1888.25	1888.75	2387	1887.25
NQ05MIG	5	9/10/2010	1050	1888.5	1890.5	1888.5	1889	2764	1887.5
NQ05MIG	5	9/10/2010	1055	1889	1891.5	1888.75	1891	1772	1889.5
NQ05MIG	5	9/10/2010	1100	1891.25	1891.5	1889.75	1890.25	1508	1888.75
NQ05MIG	5	9/10/2010	1105	1890.25	1890.5	1887.25	1888.25	2852	1886.75
NQ05MIG	5	9/10/2010	1110	1888.25	1888.5	1887.5	1888	1735	1886.5
NQ05MIG	5	9/10/2010	1115	1887.75	1888	1885.25	1886.25	3307	1884.75
NQ05MIG	5	9/10/2010	1120	1886	1887.25	1885	1885.5	1928	1884
NQ05MIG	5	9/10/2010	1125	1885.25	1887.75	1885.25	1887.5	1584	1886
NQ05MIG	5	9/10/2010	1130	1887.5	1888	1886	1886	1154	1884.5
NQ05MIG	5	9/10/2010	1135	1886	1887	1885.25	1885.5	1088	1884
NQ05MIG	5	9/10/2010	1140	1885.5	1885.75	1884.25	1884.75	2110	1883.25
NQ05MIG	5	9/10/2010	1145	1884.75	1885.5	1882.75	1883.5	2162	1882
NQ05MIG	5	9/10/2010	1150	1883.25	1884.5	1882.5	1883.25	2554	1881.75
NQ05MIG	5	9/10/2010	1155	1883.25	1883.5	1880.5	1882	3037	1880.5
NQ05MIG	5	9/10/2010	1200	1882	1882.5	1879.25	1880.25	4051	1878.75
NQ05MIG	5	9/10/2010	1205	1880.25	1880.5	1877.5	1877.75	4437	1876.25
NQ05MIG	5	9/10/2010	1210	1877.75	1880	1877.5	1879.25	2429	1877.75
NQ05MIG	5	9/10/2010	1215	1879.25	1880	1877.75	1879.75	3548	1878.25
NQ05MIG	5	9/10/2010	1220	1879.75	1882.25	1879.75	1881.75	1843	1880.25
NQ05MIG	5	9/10/2010	1225	1881.75	1882	1880.25	1880.25	1454	1878.75
NQ05MIG	5	9/10/2010	1230	1880.25	1880.25	1878	1878.5	2083	1877
NQ05MIG	5	9/10/2010	1235	1878.5	1879.75	1878.25	1879.75	1059	1878.25
NQ05MIG	5	9/10/2010	1240	1879.5	1880.75	1879	1880.75	1645	1879.25
NQ05MIG	5	9/10/2010	1245	1881	1882.75	1880.75	1881.75	1632	1880.25
NQ05MIG	5	9/10/2010	1250	1881.75	1883.5	1881.5	1883	1656	1881.5
NQ05MIG	5	9/10/2010	1255	1883.25	1883.5	1881.25	1881.75	1277	1880.25
NQ05MIG	5	9/10/2010	1300	1881.5	1882.5	1880.75	1881.25	1277	1879.75
NQ05MIG	5	9/10/2010	1305	1881.25	1883	1880.5	1882.5	1138	1881
NQ05MIG	5	9/10/2010	1310	1882.25	1883.25	1882	1882	1271	1880.5
NQ05MIG	5	9/10/2010	1315	1882.25	1883.25	1881.5	1883	1046	1881.5
NQ05MIG	5	9/10/2010	1320	1883	1883.25	1881.25	1881.75	1036	1880.25
NQ05MIG	5	9/10/2010	1325	1881.75	1883.25	1881.5	1883.25	976	1881.75
NQ05MIG	5	9/10/2010	1330	1883.25	1885.25	1882.5	1884.75	1967	1883.25
NQ05MIG	5	9/10/2010	1335	1884.75	1885	1883.75	1884.75	1718	1883.25
NQ05MIG	5	9/10/2010	1340	1885	1885	1882.75	1883.25	1720	1881.75
NQ05MIG	5	9/10/2010	1345	1883	1884	1882	1883.75	1993	1882.25
NQ05MIG	5	9/10/2010	1350	1883.75	1885	1883.25	1884	1236	1882.5
NQ05MIG	5	9/10/2010	1355	1884	1884	1883	1884	1150	1882.5
NQ05MIG	5	9/10/2010	1400	1884	1885	1883.25	1885	1218	1883.5
NQ05MIG	5	9/10/2010	1405	1885	1887.25	1884.5	1886.75	3211	1885.25
NQ05MIG	5	9/10/2010	1410	1886.75	1888	1886.5	1887	1934	1885.5
NQ05MIG	5	9/10/2010	1415	1887	1887.5	1886	1886.25	1232	1884.75
NQ05MIG	5	9/10/2010	1420	1886.5	1886.5	1885.25	1886.5	933	1885
NQ05MIG	5	9/10/2010	1425	1886.5	1890.25	1886.5	1889.25	3984	1887.75
NQ05MIG	5	9/10/2010	1430	1889.5	1890.25	1889	1889.25	2155	1887.75
NQ05MIG	5	9/10/2010	1435	1889.25	1891	1889	1890.25	1906	1888.75
NQ05MIG	5	9/10/2010	1440	1890.25	1892.25	1888.5	1892	2763	1890.5
NQ05MIG	5	9/10/2010	1445	1891.75	1892	1888.5	1888.75	2261	1887.25
NQ05MIG	5	9/10/2010	1450	1888.75	1890.25	1888.5	1889.5	1543	1888
NQ05MIG	5	9/10/2010	1455	1889.25	1890	1889.25	1889.75	1018	1888.25
NQ05MIG	5	9/10/2010	1500	1889.75	1890	1888.5	1888.5	2046	1887
NQ05MIG	5	9/10/2010	1505	1888.75	1889.5	1888	1888.25	1391	1886.75
NQ05MIG	5	9/10/2010	1510	1888.25	1889.75	1888.25	1889.25	1096	1887.75
NQ05MIG	5	9/10/2010	1515	1889.5	1891.25	1889.25	1890.75	1671	1889.25
NQ05MIG	5	9/10/2010	1520	1890.75	1890.75	1889.25	1890	998	1888.5
NQ05MIG	5	9/10/2010	1525	1890	1892.25	1890	1891.75	2190	1890.25
NQ05MIG	5	9/10/2010	1530	1891.75	1893	1891.5	1892	1519	1890.5
NQ05MIG	5	9/10/2010	1535	1892.25	1892.25	1889	1889	2325	1887.5
NQ05MIG	5	9/10/2010	1540	1889.25	1889.75	1888	1888.75	2312	1887.25
NQ05MIG	5	9/10/2010	1545	1888.75	1890	1888	1889	2500	1887.5
NQ05MIG	5	9/10/2010	1550	1889	1889.25	1888	1888.75	2399	1887.25
NQ05MIG	5	9/10/2010	1555	1889	1891	1887.5	1891	5885	1889.5
NQ05MIG	5	9/10/2010
NQ01MIR	1	12/10/2009	930	1794.25	1799.5	1794	1799	1873	1797.75
NQ01MIR	1	12/10/2009	931	1799	1801	1798.5	1800.5	1004	1799.25
NQ01MIR	1	12/10/2009	932	1800.75	1801	1800	1800.75	647	1799.5
NQ01MIR	1	12/10/2009	933	1800.75	1802	1800.5	1801.5	657	1800.25
NQ01MIR	1	12/10/2009	934	1801.75	1803.25	1801.75	1802	843	1800.75
NQ01MIR	1	12/10/2009	935	1802	1803.75	1801.25	1803.25	1084	1802
NQ01MIR	1	12/10/2009	936	1803.25	1806.75	1803.25	1806	1308	1804.75
NQ01MIR	1	12/10/2009	937	1806	1806	1804.5	1805	755	1803.75
NQ01MIR	1	12/10/2009	938	1805	1805.75	1803.75	1803.75	481	1802.5
NQ01MIR	1	12/10/2009	939	1803.75	1805.5	1803.25	1804	1038	1802.75
NQ01MIR	1	12/10/2009	940	1804	1805.5	1804	1805	1049	1803.75
NQ01MIR	1	12/10/2009	941	1805	1805	1804	1804.25	375	1803
NQ01MIR	1	12/10/2009	942	1804	1806.25	1803.75	1805.25	1323	1804
NQ01MIR	1	12/10/2009	943	1805.25	1805.75	1805.25	1805.5	375	1804.25
NQ01MIR	1	12/10/2009	944	1805.25	1805.5	1804.75	1805	511	1803.75
NQ01MIR	1	12/10/2009	945	1805	1805.75	1804.5	1804.5	871	1803.25
NQ01MIR	1	12/10/2009	946	1804.5	1805.5	1803.75	1804	1104	1802.75
NQ01MIR	1	12/10/2009	947	1804	1804.75	1803.75	1804.5	364	1803.25
NQ01MIR	1	12/10/2009	948	1804.75	1805.25	1803.75	1804	429	1802.75
NQ01MIR	1	12/10/2009	949	1804	1804.5	1803.75	1804	147	1802.75
NQ01MIR	1	12/10/2009	950	1804	1804	1802	1802.25	761	1801
NQ01MIR	1	12/10/2009	951	1802.5	1802.5	1801	1801	393	1799.75
NQ01MIR	1	12/10/2009	952	1801.25	1802	1800.5	1802	350	1800.75
NQ01MIR	1	12/10/2009	953	1802	1802	1799	1799.5	495	1798.25
NQ01MIR	1	12/10/2009	954	1799.5	1800.75	1799.25	1799.75	434	1798.5
NQ01MIR	1	12/10/2009	955	1800	1801.25	1800	1800.75	450	1799.5
NQ01MIR	1	12/10/2009	956	1800.75	1800.75	1799.75	1799.75	128	1798.5
NQ01MIR	1	12/10/2009	957	1799.5	1801	1799.5	1800.5	444	1799.25
NQ01MIR	1	12/10/2009	958	1800.5	1802	1800.5	1801.75	270	1800.5
NQ01MIR	1	12/10/2009	959	1801.75	1802.25	1799.75	1799.75	129	1798.5
NQ01MIR	1	12/10/2009	1000	1800	1800.75	1799.75	1800	270	1798.75
NQ01MIR	1	12/10/2009	1001	1800	1800	1799	1799.25	152	1798
NQ01MIR	1	12/10/2009	1002	1799.25	1799.25	1798.25	1798.25	167	1797
NQ01MIR	1	12/10/2009	1003	1798.25	1799.5	1797.5	1799.5	657	1798.25
NQ01MIR	1	12/10/2009	1004	1799.5	1799.5	1798.75	1799	312	1797.75
NQ01MIR	1	12/10/2009	1005	1799	1799.25	1797.5	1798	971	1796.75
NQ01MIR	1	12/10/2009	1006	1797.75	1798.5	1797.75	1798	293	1796.75
NQ01MIR	1	12/10/2009	1007	1798	1801.25	1797.75	1801	819	1799.75
NQ01MIR	1	12/10/2009	1008	1800.75	1801	1799.75	1800.5	373	1799.25
NQ01MIR	1	12/10/2009	1009	1800.75	1800.75	1800	1800.25	227	1799
NQ01MIR	1	12/10/2009	1010	1800.5	1801.5	1800.25	1801.25	431	1800
NQ01MIR	1	12/10/2009	1011	1801.25	1801.5	1800	1800.25	385	1799
NQ01MIR	1	12/10/2009	1012	1800	1800	1798.25	1798.25	353	1797
NQ01MIR	1	12/10/2009	1013	1798.5	1800.75	1798.5	1800.75	532	1799.5
NQ01MIR	1	12/10/2009	1014	1800.5	1800.75	1800	1800.25	212	1799
NQ01MIR	1	12/10/2009	1015	1800.25	1801.75	1800	1801.5	308	1800.25
NQ01MIR	1	12/10/2009	1016	1801.5	1802.25	1801.25	1802.25	618	1801
NQ01MIR	1	12/10/2009	1017	1802	1802.25	1800.75	1801.75	629	1800.5
NQ01MIR	1	12/10/2009	1018	1801.75	1801.75	1800.25	1800.25	235	1799
NQ01MIR	1	12/10/2009	1019	1800.25	1800.25	1799.5	1799.75	763	1798.5
NQ01MIR	1	12/10/2009	1020	1799.75	1800	1799.25	1800	1491	1798.75
NQ01MIR	1	12/10/2009	1021	1800.25	1800.75	1799.25	1800.25	302	1799
NQ01MIR	1	12/10/2009	1022	1800.25	1801.25	1800.25	1801.25	292	1800
NQ01MIR	1	12/10/2009	1023	1801.25	1802	1801	1801.75	188	1800.5
NQ01MIR	1	12/10/2009	1024	1801.75	1802.25	1801.75	1802.25	195	1801
NQ01MIR	1	12/10/2009	1025	1802	1802	1801	1801.5	451	1800.25
NQ01MIR	1	12/10/2009	1026	1801.75	1802.75	1801.75	1802.25	719	1801
NQ01MIR	1	12/10/2009	1027	1802.5	1804.75	1802.5	1804.75	534	1803.5
NQ01MIR	1	12/10/2009	1028	1804.75	1804.75	1803.5	1804	592	1802.75
NQ01MIR	1	12/10/2009	1029	1804	1804	1803	1803.25	298	1802
NQ01MIR	1	12/10/2009	1030	1803.25	1804.5	1802.5	1802.5	532	1801.25
NQ01MIR	1	12/10/2009	1031	1802.75	1804.5	1802.75	1803.25	731	1802
NQ01MIR	1	12/10/2009	1032	1803.25	1804	1803	1803	695	1801.75
NQ01MIR	1	12/10/2009	1033	1803.25	1804	1802.25	1802.5	744	1801.25
NQ01MIR	1	12/10/2009	1034	1802.75	1802.75	1802	1802.5	150	1801.25
NQ01MIR	1	12/10/2009	1035	1802.5	1802.75	1802	1802.25	152	1801
NQ01MIR	1	12/10/2009	1036	1802.25	1802.25	1801.25	1801.25	151	1800
NQ01MIR	1	12/10/2009	1037	1801.25	1801.75	1800.5	1800.75	247	1799.5
NQ01MIR	1	12/10/2009	1038	1801	1802.25	1800.75	1802	315	1800.75
NQ01MIR	1	12/10/2009	1039	1802	1802.75	1801.25	1802	538	1800.75
NQ01MIR	1	12/10/2009	1040	1802	1802.75	1801.5	1802.75	255	1801.5
NQ01MIR	1	12/10/2009	1041	1802.75	1803.75	1802.5	1803.75	299	1802.5
NQ01MIR	1	12/10/2009	1042	1803.5	1803.5	1802	1802.25	455	1801
NQ01MIR	1	12/10/2009	1043	1802.25	1802.75	1802.25	1802.25	321	1801
NQ01MIR	1	12/10/2009	1044	1802.25	1802.25	1801	1801.25	269	1800
NQ01MIR	1	12/10/2009	1045	1801.25	1801.5	1800.25	1800.75	258	1799.5
NQ01MIR	1	12/10/2009	1046	1800.75	1801.75	1800.25	1801.75	297	1800.5
NQ01MIR	1	12/10/2009	1047	1801.5	1801.5	1801	1801	124	1799.75
NQ01MIR	1	12/10/2009	1048	1800.75	1802.5	1800.75	1802.5	108	1801.25
NQ01MIR	1	12/10/2009	1049	1802.5	1802.5	1801.25	1801.25	268	1800
NQ01MIR	1	12/10/2009	1050	1801.5	1801.75	1801	1801.75	220	1800.5
NQ01MIR	1	12/10/2009	1051	1802	1802.25	1800.75	1800.75	147	1799.5
NQ01MIR	1	12/10/2009	1052	1801	1801.5	1800.75	1801.5	174	1800.25
NQ01MIR	1	12/10/2009	1053	1801.5	1802.25	1801.25	1801.25	286	1800
NQ01MIR	1	12/10/2009	1054	1801.25	1801.75	1800.75	1801.25	218	1800
NQ01MIR	1	12/10/2009	1055	1801	1802.25	1800.5	1801.25	513	1800
NQ01MIR	1	12/10/2009	1056	1801	1801.75	1800.75	1801.75	156	1800.5
NQ01MIR	1	12/10/2009	1057	1801.5	1803	1801.5	1801.75	466	1800.5
NQ01MIR	1	12/10/2009	1058	1801.75	1802	1801.5	1801.75	76	1800.5
NQ01MIR	1	12/10/2009	1059	1801.75	1802.5	1801.75	1802.25	134	1801
NQ01MIR	1	12/10/2009	1100	1802.25	1802.25	1801.5	1801.5	113	1800.25
NQ01MIR	1	12/10/2009	1101	1801.5	1802.25	1801.5	1801.5	117	1800.25
NQ01MIR	1	12/10/2009	1102	1801.75	1801.75	1801.25	1801.5	72	1800.25
NQ01MIR	1	12/10/2009	1103	1801.25	1801.75	1801.25	1801.75	127	1800.5
NQ01MIR	1	12/10/2009	1104	1802	1803.25	1802	1803.25	278	1802
NQ01MIR	1	12/10/2009	1105	1803.5	1803.75	1803.25	1803.25	446	1802
NQ01MIR	1	12/10/2009	1106	1803.25	1803.25	1802.25	1802.5	293	1801.25
NQ01MIR	1	12/10/2009	1107	1802.25	1802.75	1802.25	1802.25	277	1801
NQ01MIR	1	12/10/2009	1108	1802.25	1802.5	1802	1802.5	75	1801.25
NQ01MIR	1	12/10/2009	1109	1802.25	1802.75	1802.25	1802.75	105	1801.5
NQ01MIR	1	12/10/2009	1110	1802.75	1803	1802.5	1802.75	264	1801.5
NQ01MIR	1	12/10/2009	1111	1802.75	1802.75	1801.75	1801.75	221	1800.5
NQ01MIR	1	12/10/2009	1112	1801.5	1802.5	1801.5	1802.5	715	1801.25
NQ01MIR	1	12/10/2009	1113	1802.5	1803.5	1802.5	1803.5	524	1802.25
NQ01MIR	1	12/10/2009	1114	1803.5	1803.75	1802.75	1802.75	368	1801.5
NQ01MIR	1	12/10/2009	1115	1802.75	1805	1802.75	1804.25	523	1803
NQ01MIR	1	12/10/2009	1116	1804.25	1804.75	1804	1804.5	260	1803.25
NQ01MIR	1	12/10/2009	1117	1804.5	1805.25	1804.5	1805	472	1803.75
NQ01MIR	1	12/10/2009	1118	1805	1805	1804	1804.25	186	1803
NQ01MIR	1	12/10/2009	1119	1804.5	1804.5	1804	1804.25	406	1803
NQ01MIR	1	12/10/2009	1120	1804.25	1804.5	1803.5	1803.5	769	1802.25
NQ01MIR	1	12/10/2009	1121	1803.75	1804	1803.75	1804	226	1802.75
NQ01MIR	1	12/10/2009	1122	1804	1804	1803	1803	196	1801.75
NQ01MIR	1	12/10/2009	1123	1803.25	1803.75	1803	1803.5	214	1802.25
NQ01MIR	1	12/10/2009	1124	1803.25	1803.5	1803	1803.5	167	1802.25
NQ01MIR	1	12/10/2009	1125	1803.5	1804	1803.5	1803.5	212	1802.25
NQ01MIR	1	12/10/2009	1126	1803.25	1803.25	1802.25	1803	490	1801.75
NQ01MIR	1	12/10/2009	1127	1803.25	1804.75	1803.25	1803.25	528	1802
NQ01MIR	1	12/10/2009	1128	1803.5	1804.25	1802.75	1803.5	221	1802.25
NQ01MIR	1	12/10/2009	1129	1803.5	1803.75	1802.5	1803.25	506	1802
NQ01MIR	1	12/10/2009	1130	1803.25	1803.25	1803	1803	81	1801.75
NQ01MIR	1	12/10/2009	1131	1803.25	1803.75	1802.75	1803.75	178	1802.5
NQ01MIR	1	12/10/2009	1132	1803.75	1805	1803.25	1805	781	1803.75
NQ01MIR	1	12/10/2009	1133	1804.75	1805.25	1804.5	1805.25	503	1804
NQ01MIR	1	12/10/2009	1134	1805.25	1805.25	1803.5	1803.5	202	1802.25
NQ01MIR	1	12/10/2009	1135	1803.5	1804	1802.75	1803.5	425	1802.25
NQ01MIR	1	12/10/2009	1136	1803.25	1804.25	1803.25	1804.25	242	1803
NQ01MIR	1	12/10/2009	1137	1804	1804.25	1803	1803.25	636	1802
NQ01MIR	1	12/10/2009	1138	1803.25	1804	1802.75	1804	267	1802.75
NQ01MIR	1	12/10/2009	1139	1803.75	1803.75	1803.25	1803.5	125	1802.25
NQ01MIR	1	12/10/2009	1140	1803.75	1803.75	1802.75	1802.75	134	1801.5
NQ01MIR	1	12/10/2009	1141	1802.75	1803	1802.75	1802.75	72	1801.5
NQ01MIR	1	12/10/2009	1142	1802.75	1803.75	1802.5	1803.75	525	1802.5
NQ01MIR	1	12/10/2009	1143	1803.75	1803.75	1802.25	1802.5	212	1801.25
NQ01MIR	1	12/10/2009	1144	1802.5	1803.25	1802.25	1802.25	317	1801
NQ01MIR	1	12/10/2009	1145	1802.25	1802.75	1801.75	1802.5	287	1801.25
NQ01MIR	1	12/10/2009	1146	1802.5	1802.5	1802.25	1802.5	75	1801.25
NQ01MIR	1	12/10/2009	1147	1802.5	1802.5	1802	1802.5	215	1801.25
NQ01MIR	1	12/10/2009	1148	1802.5	1802.75	1802.25	1802.75	73	1801.5
NQ01MIR	1	12/10/2009	1149	1802.75	1803.5	1802.25	1803.5	318	1802.25
NQ01MIR	1	12/10/2009	1150	1803.25	1803.25	1802.5	1802.75	222	1801.5
NQ01MIR	1	12/10/2009	1151	1802.75	1802.75	1802	1802.25	156	1801
NQ01MIR	1	12/10/2009	1152	1802.5	1802.5	1801.25	1802.5	357	1801.25
NQ01MIR	1	12/10/2009	1153	1802.25	1802.25	1801.75	1801.75	124	1800.5
NQ01MIR	1	12/10/2009	1154	1802	1802.75	1802	1802.5	177	1801.25
NQ01MIR	1	12/10/2009	1155	1802.25	1802.5	1802	1802.25	185	1801
NQ01MIR	1	12/10/2009	1156	1802.25	1802.25	1801.75	1801.75	175	1800.5
NQ01MIR	1	12/10/2009	1157	1802	1802.25	1802	1802	86	1800.75
NQ01MIR	1	12/10/2009	1158	1802	1802.25	1802	1802	103	1800.75
NQ01MIR	1	12/10/2009	1159	1802	1803	1801.75	1801.75	275	1800.5
NQ01MIR	1	12/10/2009	1200	1801.75	1802.25	1801.5	1802	99	1800.75
NQ01MIR	1	12/10/2009	1201	1802	1802.5	1802	1802.25	135	1801
NQ01MIR	1	12/10/2009	1202	1802.25	1802.5	1801.75	1802.5	119	1801.25
NQ01MIR	1	12/10/2009	1203	1802.25	1802.5	1801.75	1802	198	1800.75
NQ01MIR	1	12/10/2009	1204	1802	1803	1802	1803	302	1801.75
NQ01MIR	1	12/10/2

Did you look at the two .txt files with a text editor?

There is something glaringly wrong with the 2nd longer file ... it seems quite corrupted, just a little way into it ...

Using an editor ... like notepad ... or programmers notepad ... take a look !

Edited 1 Year Ago by David W

David,

I looked at the five mintest.txt file in notepad and didn't notice anything unusual. What I see is two days worth of data, spanning 9/9/2010 to 9/10/2010. Did you see something else?

Thanks.

The longer (2nd) file length is given as 194.93 KB

The shorter (1st and good) file length is given as 78.12 KB

Did you not see 'a problem' with (all) the (missing) contents of the (supposed to be) longer file?

Note: I am looking at/comparing the two .txt files using my iPhone.

Edited 1 Year Ago by David W

The 5 minute data is only valid for the first 10420 bytes.
Thereafter, the data is padded with the following sequence of bytes:

0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x0D 0x0A

Edited 1 Year Ago by nullptr

David and Nullptr,

Thanks. Nullptr, sorry for the silly question, how did you get to 'see' those bytes? And what can I do to fix the file? I basically have the data in a much larger excel file that spans 3 months. So if I only want to use a few days of it say, is copy/paste not the right method? Should I instead try deleting all unwanted data first in the excel file and then saving as a txt file?

Edited 1 Year Ago by toneranger

I attached a new 5 min file i tried with, but no luck. I made this one to be only a few days long with no extraneous lines in it. But still aborting at runtime, frustrating.

Attachments
NQ05MIR	5	12/10/2009	930	1794.25	1803.25	1794	1802	5024	1800.75
NQ05MIR	5	12/10/2009	935	1802	1806.75	1801.25	1804	4666	1802.75
NQ05MIR	5	12/10/2009	940	1804	1806.25	1803.75	1805	3633	1803.75
NQ05MIR	5	12/10/2009	945	1805	1805.75	1803.75	1804	2915	1802.75
NQ05MIR	5	12/10/2009	950	1804	1804	1799	1799.75	2433	1798.5
NQ05MIR	5	12/10/2009	955	1800	1802.25	1799.5	1799.75	1421	1798.5
NQ05MIR	5	12/10/2009	1000	1800	1800.75	1797.5	1799	1558	1797.75
NQ05MIR	5	12/10/2009	1005	1799	1801.25	1797.5	1800.25	2683	1799
NQ05MIR	5	12/10/2009	1010	1800.5	1801.5	1798.25	1800.25	1913	1799
NQ05MIR	5	12/10/2009	1015	1800.25	1802.25	1799.5	1799.75	2553	1798.5
NQ05MIR	5	12/10/2009	1020	1799.75	1802.25	1799.25	1802.25	2468	1801
NQ05MIR	5	12/10/2009	1025	1802	1804.75	1801	1803.25	2594	1802
NQ05MIR	5	12/10/2009	1030	1803.25	1804.5	1802	1802.5	2852	1801.25
NQ05MIR	5	12/10/2009	1035	1802.5	1802.75	1800.5	1802	1403	1800.75
NQ05MIR	5	12/10/2009	1040	1802	1803.75	1801	1801.25	1599	1800
NQ05MIR	5	12/10/2009	1045	1801.25	1802.5	1800.25	1801.25	1055	1800
NQ05MIR	5	12/10/2009	1050	1801.5	1802.25	1800.75	1801.25	1045	1800
NQ05MIR	5	12/10/2009	1055	1801	1803	1800.5	1802.25	1345	1801
NQ05MIR	5	12/10/2009	1100	1802.25	1803.25	1801.25	1803.25	707	1802
NQ05MIR	5	12/10/2009	1105	1803.5	1803.75	1802	1802.75	1196	1801.5
NQ05MIR	5	12/10/2009	1110	1802.75	1803.75	1801.5	1802.75	2092	1801.5
NQ05MIR	5	12/10/2009	1115	1802.75	1805.25	1802.75	1804.25	1847	1803
NQ05MIR	5	12/10/2009	1120	1804.25	1804.5	1803	1803.5	1572	1802.25
NQ05MIR	5	12/10/2009	1125	1803.5	1804.75	1802.25	1803.25	1957	1802
NQ05MIR	5	12/10/2009	1130	1803.25	1805.25	1802.75	1803.5	1745	1802.25
NQ05MIR	5	12/10/2009	1135	1803.5	1804.25	1802.75	1803.5	1695	1802.25
NQ05MIR	5	12/10/2009	1140	1803.75	1803.75	1802.25	1802.25	1260	1801
NQ05MIR	5	12/10/2009	1145	1802.25	1803.5	1801.75	1803.5	968	1802.25
NQ05MIR	5	12/10/2009	1150	1803.25	1803.25	1801.25	1802.5	1036	1801.25
NQ05MIR	5	12/10/2009	1155	1802.25	1803	1801.75	1801.75	824	1800.5
NQ05MIR	5	12/10/2009	1200	1801.75	1803	1801.5	1803	853	1801.75
NQ05MIR	5	12/10/2009	1205	1803	1804.25	1801.75	1802.75	2528	1801.5
NQ05MIR	5	12/10/2009	1210	1802.75	1803	1801.25	1801.25	1918	1800
NQ05MIR	5	12/10/2009	1215	1801	1802.75	1800.75	1802.75	1546	1801.5
NQ05MIR	5	12/10/2009	1220	1802.5	1802.5	1801.25	1801.75	836	1800.5
NQ05MIR	5	12/10/2009	1225	1801.75	1802.25	1801.25	1801.75	555	1800.5
NQ05MIR	5	12/10/2009	1230	1801.5	1802	1800.75	1801.75	1060	1800.5
NQ05MIR	5	12/10/2009	1235	1801.75	1801.75	1800.75	1801.25	1137	1800
NQ05MIR	5	12/10/2009	1240	1801.25	1802.5	1801	1802.25	1277	1801
NQ05MIR	5	12/10/2009	1245	1802.25	1804.25	1802.25	1804	1011	1802.75
NQ05MIR	5	12/10/2009	1250	1803.75	1804.5	1803.75	1804	533	1802.75
NQ05MIR	5	12/10/2009	1255	1804	1804.75	1803.75	1804.75	380	1803.5
NQ05MIR	5	12/10/2009	1300	1804.5	1804.75	1801.5	1802.25	1683	1801
NQ05MIR	5	12/10/2009	1305	1802.25	1803.5	1799.5	1799.75	1324	1798.5
NQ05MIR	5	12/10/2009	1310	1799.75	1800.25	1797	1797.5	2001	1796.25
NQ05MIR	5	12/10/2009	1315	1797.5	1799	1797	1797.5	1476	1796.25
NQ05MIR	5	12/10/2009	1320	1797.5	1799.25	1797	1798.5	1354	1797.25
NQ05MIR	5	12/10/2009	1325	1798.5	1799.5	1798.5	1799.25	795	1798
NQ05MIR	5	12/10/2009	1330	1799.25	1800.5	1799.25	1800	801	1798.75
NQ05MIR	5	12/10/2009	1335	1799.75	1801.5	1799.25	1801.5	863	1800.25
NQ05MIR	5	12/10/2009	1340	1801.5	1802	1800	1801.5	768	1800.25
NQ05MIR	5	12/10/2009	1345	1801.5	1801.5	1799.75	1801	299	1799.75
NQ05MIR	5	12/10/2009	1350	1801	1801.25	1799.75	1799.75	352	1798.5
NQ05MIR	5	12/10/2009	1355	1799.75	1801.5	1799.5	1801.25	474	1800
NQ05MIR	5	12/10/2009	1400	1801.25	1801.25	1800	1801.25	515	1800
NQ05MIR	5	12/10/2009	1405	1801.25	1802.5	1801.25	1801.75	900	1800.5
NQ05MIR	5	12/10/2009	1410	1801.75	1801.75	1800.75	1801.75	829	1800.5
NQ05MIR	5	12/10/2009	1415	1802	1803.25	1801.75	1803.25	808	1802
NQ05MIR	5	12/10/2009	1420	1803.25	1803.5	1802.25	1802.25	949	1801
NQ05MIR	5	12/10/2009	1425	1802.25	1803.25	1802.25	1802.75	975	1801.5
NQ05MIR	5	12/10/2009	1430	1802.75	1803.75	1802.75	1803.25	372	1802
NQ05MIR	5	12/10/2009	1435	1803.25	1803.25	1802	1802.5	449	1801.25
NQ05MIR	5	12/10/2009	1440	1802.5	1802.5	1800.25	1801	1235	1799.75
NQ05MIR	5	12/10/2009	1445	1801	1802.75	1801	1801.75	1030	1800.5
NQ05MIR	5	12/10/2009	1450	1802	1802	1801	1802	862	1800.75
NQ05MIR	5	12/10/2009	1455	1802	1802	1801.25	1801.75	372	1800.5
NQ05MIR	5	12/10/2009	1500	1801.75	1802	1800.25	1800.25	895	1799
NQ05MIR	5	12/10/2009	1505	1800.25	1801.75	1799.75	1800.5	1322	1799.25
NQ05MIR	5	12/10/2009	1510	1800.25	1803	1800.25	1801.5	867	1800.25
NQ05MIR	5	12/10/2009	1515	1801.5	1802.25	1800.75	1801	463	1799.75
NQ05MIR	5	12/10/2009	1520	1800.75	1800.75	1798.75	1798.75	815	1797.5
NQ05MIR	5	12/10/2009	1525	1798.75	1799.25	1796	1796.5	1739	1795.25
NQ05MIR	5	12/10/2009	1530	1796.5	1797.25	1795	1796	1545	1794.75
NQ05MIR	5	12/10/2009	1535	1796	1797.75	1795.75	1797.5	1059	1796.25
NQ05MIR	5	12/10/2009	1540	1797.5	1798	1796.5	1797.75	1026	1796.5
NQ05MIR	5	12/10/2009	1545	1797.75	1799.5	1797.25	1799.25	1015	1798
NQ05MIR	5	12/10/2009	1550	1799.25	1799.5	1796.75	1797.75	1868	1796.5
NQ05MIR	5	12/10/2009	1555	1797.75	1798.25	1796.25	1796.25	5325	1795
NQ05MIR	5	12/10/2009	1600	1796.5	1798.5	1796	1797.75	2151	1796.5
NQ05MIR	5	12/10/2009	1605	1798	1798.5	1797.75	1798.5	886	1797.25
NQ05MIR	5	12/10/2009	1610	1798.25	1798.75	1796.75	1798.25	2073	1797
NQ05MIR	5	12/11/2009	930	1805.75	1808.75	1803	1803	4448	1801.75
NQ05MIR	5	12/11/2009	935	1803	1805	1802.25	1804	4006	1802.75
NQ05MIR	5	12/11/2009	940	1803.75	1806	1803.25	1803.25	3357	1802
NQ05MIR	5	12/11/2009	945	1803.5	1805	1800.5	1800.75	3566	1799.5
NQ05MIR	5	12/11/2009	950	1800.75	1804.5	1797.75	1803.75	6303	1802.5
NQ05MIR	5	12/11/2009	955	1804	1807.75	1799.75	1804.75	7899	1803.5
NQ05MIR	5	12/11/2009	1000	1805.25	1805.75	1801.5	1801.5	3078	1800.25
NQ05MIR	5	12/11/2009	1005	1801.75	1802.5	1799.25	1800.25	3482	1799
NQ05MIR	5	12/11/2009	1010	1800.25	1802	1799.25	1800.5	4871	1799.25
NQ05MIR	5	12/11/2009	1015	1800.25	1800.25	1796.5	1799.5	3541	1798.25
NQ05MIR	5	12/11/2009	1020	1799.5	1799.75	1796.25	1797.25	4677	1796
NQ05MIR	5	12/11/2009	1025	1797.25	1799.5	1797	1799.25	1750	1798
NQ05MIR	5	12/11/2009	1030	1799	1801.5	1798.25	1800.25	3359	1799
NQ05MIR	5	12/11/2009	1035	1800	1801.5	1799	1800.25	2890	1799
NQ05MIR	5	12/11/2009	1040	1800.25	1800.25	1798.25	1799.5	998	1798.25
NQ05MIR	5	12/11/2009	1045	1799.25	1800.25	1798.75	1799	1204	1797.75
NQ05MIR	5	12/11/2009	1050	1799.25	1800.75	1798.75	1800.25	1334	1799
NQ05MIR	5	12/11/2009	1055	1800.5	1802.25	1799.5	1799.5	2097	1798.25
NQ05MIR	5	12/11/2009	1100	1799.5	1799.75	1796.75	1797	2222	1795.75
NQ05MIR	5	12/11/2009	1105	1797	1797.5	1795	1795.25	2549	1794
NQ05MIR	5	12/11/2009	1110	1795	1795.5	1794.25	1794.5	2125	1793.25
NQ05MIR	5	12/11/2009	1115	1794.5	1796.5	1794.25	1794.5	2762	1793.25
NQ05MIR	5	12/11/2009	1120	1794.25	1794.25	1787.25	1787.5	7489	1786.25
NQ05MIR	5	12/11/2009	1125	1787.75	1788.75	1785.5	1787.25	7740	1786
NQ05MIR	5	12/11/2009	1130	1787.25	1787.5	1785	1787.25	5214	1786
NQ05MIR	5	12/11/2009	1135	1787	1788	1785.5	1787.5	3377	1786.25
NQ05MIR	5	12/11/2009	1140	1787.5	1787.5	1785	1786	3201	1784.75
NQ05MIR	5	12/11/2009	1145	1786	1786	1782.5	1783.75	7228	1782.5
NQ05MIR	5	12/11/2009	1150	1783.75	1785.25	1783	1785	2676	1783.75
NQ05MIR	5	12/11/2009	1155	1785	1785.5	1783.25	1785.25	2574	1784
NQ05MIR	5	12/11/2009	1200	1785	1786.5	1785	1785.25	1453	1784
NQ05MIR	5	12/11/2009	1205	1785.5	1787	1785.25	1786.75	1534	1785.5
NQ05MIR	5	12/11/2009	1210	1786.75	1788	1786.5	1787	1904	1785.75
NQ05MIR	5	12/11/2009	1215	1786.75	1788	1786.75	1787	725	1785.75
NQ05MIR	5	12/11/2009	1220	1787.25	1787.75	1786.25	1786.25	2027	1785
NQ05MIR	5	12/11/2009	1225	1786.25	1787	1786	1786.75	1330	1785.5
NQ05MIR	5	12/11/2009	1230	1786.5	1787.5	1786	1787	2299	1785.75
NQ05MIR	5	12/11/2009	1235	1787.25	1788	1786.5	1787.75	725	1786.5
NQ05MIR	5	12/11/2009	1240	1787.75	1787.75	1787	1787.25	683	1786
NQ05MIR	5	12/11/2009	1245	1787.5	1787.5	1786.25	1786.75	2899	1785.5
NQ05MIR	5	12/11/2009	1250	1786.5	1790.5	1786.5	1790.25	2310	1789
NQ05MIR	5	12/11/2009	1255	1790.5	1791.75	1790	1791.25	1971	1790
NQ05MIR	5	12/11/2009	1300	1791.5	1792.5	1791.25	1791.25	1015	1790
NQ05MIR	5	12/11/2009	1305	1791	1791.25	1790.5	1790.75	800	1789.5
NQ05MIR	5	12/11/2009	1310	1790.75	1791.25	1790.25	1790.5	596	1789.25
NQ05MIR	5	12/11/2009	1315	1790.25	1791	1789.75	1790.25	774	1789
NQ05MIR	5	12/11/2009	1320	1790.25	1790.75	1790	1790.25	574	1789
NQ05MIR	5	12/11/2009	1325	1790	1790.25	1789	1789.5	728	1788.25
NQ05MIR	5	12/11/2009	1330	1789.75	1790.25	1789	1789.5	602	1788.25
NQ05MIR	5	12/11/2009	1335	1789.5	1790.75	1789.25	1790.75	691	1789.5
NQ05MIR	5	12/11/2009	1340	1790.75	1791	1790	1790	936	1788.75
NQ05MIR	5	12/11/2009	1345	1790	1790.25	1789.25	1789.5	737	1788.25
NQ05MIR	5	12/11/2009	1350	1789.25	1790	1788.75	1789	765	1787.75
NQ05MIR	5	12/11/2009	1355	1789	1790.5	1788.75	1790	860	1788.75
NQ05MIR	5	12/11/2009	1400	1790	1791.25	1789.25	1790	2121	1788.75
NQ05MIR	5	12/11/2009	1405	1789.75	1792.5	1789.75	1792	1949	1790.75
NQ05MIR	5	12/11/2009	1410	1791.75	1792.5	1791.5	1791.75	1130	1790.5
NQ05MIR	5	12/11/2009	1415	1791.75	1791.75	1791	1791	521	1789.75
NQ05MIR	5	12/11/2009	1420	1791	1792	1790.75	1791.25	1115	1790
NQ05MIR	5	12/11/2009	1425	1791	1791.5	1790.5	1791	933	1789.75
NQ05MIR	5	12/11/2009	1430	1791	1791.5	1790	1790	1180	1788.75
NQ05MIR	5	12/11/2009	1435	1790	1790	1788.5	1789	849	1787.75
NQ05MIR	5	12/11/2009	1440	1789	1790	1788	1789.25	1923	1788
NQ05MIR	5	12/11/2009	1445	1789.25	1791	1789.25	1789.75	1078	1788.5
NQ05MIR	5	12/11/2009	1450	1789.5	1790.75	1789.5	1789.75	1168	1788.5
NQ05MIR	5	12/11/2009	1455	1789.75	1790.75	1789	1789.25	1639	1788
NQ05MIR	5	12/11/2009	1500	1789	1790	1788.5	1790	1012	1788.75
NQ05MIR	5	12/11/2009	1505	1790	1790.25	1789.5	1789.5	574	1788.25
NQ05MIR	5	12/11/2009	1510	1789.75	1791.25	1789.25	1791	1284	1789.75
NQ05MIR	5	12/11/2009	1515	1791	1791	1789.75	1790	756	1788.75
NQ05MIR	5	12/11/2009	1520	1789.75	1791.25	1789	1790.5	1323	1789.25
NQ05MIR	5	12/11/2009	1525	1790.75	1793.25	1790.75	1793	2501	1791.75
NQ05MIR	5	12/11/2009	1530	1793	1794	1792.25	1793	2677	1791.75

Without seeing all the code you are using ... we can only guess at the problem(s), according to our own experience.

Inspect the good (working ok) 1st file ... by loading it into a text editor, like notepad, and see if there is one and only one newline char at the end of the last line of data there ... or if instead, that last line ends with EOF ? (i.e. NO newline char there.)

Then, make sure, (using a text editor), that the 2nd file ends like the first.

This will resolve the problem if the issue is (only) related to how you program reads lines of data and in particular the last line.

Another possible issue is the possibility of unrecognized char's being embedded in the 2nd data file chunk ... and then, the program may be halting with an exception thrown there ... but check out first idea above .. firstly ... as that 'data file (corruption and/or ending) problem' is suggested by the original two data .txt files you presented.

Edited 1 Year Ago by David W

Shouldn't line 163 - 167 be:

    std::vector<SwingIdentified>::iterator SwingIter; 
    for (SwingIter= NamedSwings.begin(); SwingIter!=NamedSwings.end(); SwingIter++) 
    {   
        outfile << *SwingIter << std::endl; // <==
    }

Hi David,

I found this code below online and gave it a try to read the last line in each of the two files. In the file that works, "csv file.txt", the output to the below is nothing, i.e., an empty line. In the file that doesn't work, "09five.txt", the output for the last line is the last line of data:

NQ05MIR 5 12/14/2009 1610 1806.25 1808 1805.75 1807.5 2698 1806.25

So, does that mean that in the case of the "csv file.txt", the last line ends with either a /n or newline?

Flying blind here, could really use your help/code if you can share. Thanks.

int main(int argc, char const* argv[])
{
    std::ifstream read ("csv file.txt", std::ios_base::ate);
    std::string tmp;
    int length = 0;

    char c = '\0';

    if (read)
    {

        length = read.tellg();

        for (int i = length-2; i> 0; i--)

        {
            read.seekg(i);
            c = read.get();
            if (c =='r' || c == '\n')
                break;
        }

        std::getline(read, tmp);//read last line
        std::cout << tmp << std::endl; // print it

    }

    return 0;

Nullptr,

I changed the NamedSwings to the dereferenced iterator as you suggested, but still the same abort at runtime. I checked out what you said earlier about this line:

0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x0D 0x0A

And it looks like it's a bunch of \n \r and \t

not sure what to do from here

Edited 1 Year Ago by toneranger

So add a 'newline' char to the end of the bad '2nd' file to make it match the ending in the 'good 1st' file and try it then.

Edited 1 Year Ago by David W

Tried it with another 5 min file which ends with a blank line and no luck, still aborts. I've attached below:

So, I noticed that the code gets through the first function in my "main", because it appends the data to a file, but it doesn't make it to my moving average function (below) because it doesn't create the "MA.txt" file. Do you see anything glaringly wrong below?

int CalcMovingAverage (int a, std::vector<PriceInfo>& priceinput)

{

std::vector<PriceInfo>::iterator itr; 
itr = priceinput.begin();
std::string first_Date;
first_Date = itr->Date;

int length = a;
int count = 0;
double sum = 0;


if (itr->Date == first_Date) 


for (;itr!= priceinput.end();) 

{
    sum += itr->Close;
    count ++;
    if (count >= length)

    {
        itr->MovingAve = (sum / (double) length);
        sum -= (itr-(count-length))->Close;

    }



    else

    {
        first_Date = itr->Date;

        }


  ++ itr;

 }


    std::ofstream outfile2;
    outfile2.clear ();
    outfile2.open ("MA.txt", ios::app);
    std::vector<PriceInfo>::iterator it2; 
    it2 = priceinput.begin();

    for (it2= priceinput.begin(); it2!=priceinput.end(); it2++) 

{   
    outfile2 << priceinput << std::endl;
}

    return 0;
}

Edited 1 Year Ago by toneranger

Attachments
NQ05MIR	5	12/10/2009	930	1794.25	1803.25	1794	1802	5024	1800.75
NQ05MIR	5	12/10/2009	935	1802	1806.75	1801.25	1804	4666	1802.75
NQ05MIR	5	12/10/2009	940	1804	1806.25	1803.75	1805	3633	1803.75
NQ05MIR	5	12/10/2009	945	1805	1805.75	1803.75	1804	2915	1802.75
NQ05MIR	5	12/10/2009	950	1804	1804	1799	1799.75	2433	1798.5
NQ05MIR	5	12/10/2009	955	1800	1802.25	1799.5	1799.75	1421	1798.5
NQ05MIR	5	12/10/2009	1000	1800	1800.75	1797.5	1799	1558	1797.75
NQ05MIR	5	12/10/2009	1005	1799	1801.25	1797.5	1800.25	2683	1799
NQ05MIR	5	12/10/2009	1010	1800.5	1801.5	1798.25	1800.25	1913	1799
NQ05MIR	5	12/10/2009	1015	1800.25	1802.25	1799.5	1799.75	2553	1798.5
NQ05MIR	5	12/10/2009	1020	1799.75	1802.25	1799.25	1802.25	2468	1801
NQ05MIR	5	12/10/2009	1025	1802	1804.75	1801	1803.25	2594	1802
NQ05MIR	5	12/10/2009	1030	1803.25	1804.5	1802	1802.5	2852	1801.25
NQ05MIR	5	12/10/2009	1035	1802.5	1802.75	1800.5	1802	1403	1800.75
NQ05MIR	5	12/10/2009	1040	1802	1803.75	1801	1801.25	1599	1800
NQ05MIR	5	12/10/2009	1045	1801.25	1802.5	1800.25	1801.25	1055	1800
NQ05MIR	5	12/10/2009	1050	1801.5	1802.25	1800.75	1801.25	1045	1800
NQ05MIR	5	12/10/2009	1055	1801	1803	1800.5	1802.25	1345	1801
NQ05MIR	5	12/10/2009	1100	1802.25	1803.25	1801.25	1803.25	707	1802
NQ05MIR	5	12/10/2009	1105	1803.5	1803.75	1802	1802.75	1196	1801.5
NQ05MIR	5	12/10/2009	1110	1802.75	1803.75	1801.5	1802.75	2092	1801.5
NQ05MIR	5	12/10/2009	1115	1802.75	1805.25	1802.75	1804.25	1847	1803
NQ05MIR	5	12/10/2009	1120	1804.25	1804.5	1803	1803.5	1572	1802.25
NQ05MIR	5	12/10/2009	1125	1803.5	1804.75	1802.25	1803.25	1957	1802
NQ05MIR	5	12/10/2009	1130	1803.25	1805.25	1802.75	1803.5	1745	1802.25
NQ05MIR	5	12/10/2009	1135	1803.5	1804.25	1802.75	1803.5	1695	1802.25
NQ05MIR	5	12/10/2009	1140	1803.75	1803.75	1802.25	1802.25	1260	1801
NQ05MIR	5	12/10/2009	1145	1802.25	1803.5	1801.75	1803.5	968	1802.25
NQ05MIR	5	12/10/2009	1150	1803.25	1803.25	1801.25	1802.5	1036	1801.25
NQ05MIR	5	12/10/2009	1155	1802.25	1803	1801.75	1801.75	824	1800.5
NQ05MIR	5	12/10/2009	1200	1801.75	1803	1801.5	1803	853	1801.75
NQ05MIR	5	12/10/2009	1205	1803	1804.25	1801.75	1802.75	2528	1801.5
NQ05MIR	5	12/10/2009	1210	1802.75	1803	1801.25	1801.25	1918	1800
NQ05MIR	5	12/10/2009	1215	1801	1802.75	1800.75	1802.75	1546	1801.5
NQ05MIR	5	12/10/2009	1220	1802.5	1802.5	1801.25	1801.75	836	1800.5
NQ05MIR	5	12/10/2009	1225	1801.75	1802.25	1801.25	1801.75	555	1800.5
NQ05MIR	5	12/10/2009	1230	1801.5	1802	1800.75	1801.75	1060	1800.5
NQ05MIR	5	12/10/2009	1235	1801.75	1801.75	1800.75	1801.25	1137	1800
NQ05MIR	5	12/10/2009	1240	1801.25	1802.5	1801	1802.25	1277	1801
NQ05MIR	5	12/10/2009	1245	1802.25	1804.25	1802.25	1804	1011	1802.75
NQ05MIR	5	12/10/2009	1250	1803.75	1804.5	1803.75	1804	533	1802.75
NQ05MIR	5	12/10/2009	1255	1804	1804.75	1803.75	1804.75	380	1803.5
NQ05MIR	5	12/10/2009	1300	1804.5	1804.75	1801.5	1802.25	1683	1801
NQ05MIR	5	12/10/2009	1305	1802.25	1803.5	1799.5	1799.75	1324	1798.5
NQ05MIR	5	12/10/2009	1310	1799.75	1800.25	1797	1797.5	2001	1796.25
NQ05MIR	5	12/10/2009	1315	1797.5	1799	1797	1797.5	1476	1796.25
NQ05MIR	5	12/10/2009	1320	1797.5	1799.25	1797	1798.5	1354	1797.25
NQ05MIR	5	12/10/2009	1325	1798.5	1799.5	1798.5	1799.25	795	1798
NQ05MIR	5	12/10/2009	1330	1799.25	1800.5	1799.25	1800	801	1798.75
NQ05MIR	5	12/10/2009	1335	1799.75	1801.5	1799.25	1801.5	863	1800.25
NQ05MIR	5	12/10/2009	1340	1801.5	1802	1800	1801.5	768	1800.25
NQ05MIR	5	12/10/2009	1345	1801.5	1801.5	1799.75	1801	299	1799.75
NQ05MIR	5	12/10/2009	1350	1801	1801.25	1799.75	1799.75	352	1798.5
NQ05MIR	5	12/10/2009	1355	1799.75	1801.5	1799.5	1801.25	474	1800
NQ05MIR	5	12/10/2009	1400	1801.25	1801.25	1800	1801.25	515	1800
NQ05MIR	5	12/10/2009	1405	1801.25	1802.5	1801.25	1801.75	900	1800.5
NQ05MIR	5	12/10/2009	1410	1801.75	1801.75	1800.75	1801.75	829	1800.5
NQ05MIR	5	12/10/2009	1415	1802	1803.25	1801.75	1803.25	808	1802
NQ05MIR	5	12/10/2009	1420	1803.25	1803.5	1802.25	1802.25	949	1801
NQ05MIR	5	12/10/2009	1425	1802.25	1803.25	1802.25	1802.75	975	1801.5
NQ05MIR	5	12/10/2009	1430	1802.75	1803.75	1802.75	1803.25	372	1802
NQ05MIR	5	12/10/2009	1435	1803.25	1803.25	1802	1802.5	449	1801.25
NQ05MIR	5	12/10/2009	1440	1802.5	1802.5	1800.25	1801	1235	1799.75
NQ05MIR	5	12/10/2009	1445	1801	1802.75	1801	1801.75	1030	1800.5
NQ05MIR	5	12/10/2009	1450	1802	1802	1801	1802	862	1800.75
NQ05MIR	5	12/10/2009	1455	1802	1802	1801.25	1801.75	372	1800.5
NQ05MIR	5	12/10/2009	1500	1801.75	1802	1800.25	1800.25	895	1799
NQ05MIR	5	12/10/2009	1505	1800.25	1801.75	1799.75	1800.5	1322	1799.25
NQ05MIR	5	12/10/2009	1510	1800.25	1803	1800.25	1801.5	867	1800.25
NQ05MIR	5	12/10/2009	1515	1801.5	1802.25	1800.75	1801	463	1799.75
NQ05MIR	5	12/10/2009	1520	1800.75	1800.75	1798.75	1798.75	815	1797.5
NQ05MIR	5	12/10/2009	1525	1798.75	1799.25	1796	1796.5	1739	1795.25
NQ05MIR	5	12/10/2009	1530	1796.5	1797.25	1795	1796	1545	1794.75
NQ05MIR	5	12/10/2009	1535	1796	1797.75	1795.75	1797.5	1059	1796.25
NQ05MIR	5	12/10/2009	1540	1797.5	1798	1796.5	1797.75	1026	1796.5
NQ05MIR	5	12/10/2009	1545	1797.75	1799.5	1797.25	1799.25	1015	1798
NQ05MIR	5	12/10/2009	1550	1799.25	1799.5	1796.75	1797.75	1868	1796.5
NQ05MIR	5	12/10/2009	1555	1797.75	1798.25	1796.25	1796.25	5325	1795
NQ05MIR	5	12/10/2009	1600	1796.5	1798.5	1796	1797.75	2151	1796.5
NQ05MIR	5	12/10/2009	1605	1798	1798.5	1797.75	1798.5	886	1797.25
NQ05MIR	5	12/10/2009	1610	1798.25	1798.75	1796.75	1798.25	2073	1797
NQ05MIR	5	12/11/2009	930	1805.75	1808.75	1803	1803	4448	1801.75
NQ05MIR	5	12/11/2009	935	1803	1805	1802.25	1804	4006	1802.75
NQ05MIR	5	12/11/2009	940	1803.75	1806	1803.25	1803.25	3357	1802
NQ05MIR	5	12/11/2009	945	1803.5	1805	1800.5	1800.75	3566	1799.5
NQ05MIR	5	12/11/2009	950	1800.75	1804.5	1797.75	1803.75	6303	1802.5
NQ05MIR	5	12/11/2009	955	1804	1807.75	1799.75	1804.75	7899	1803.5
NQ05MIR	5	12/11/2009	1000	1805.25	1805.75	1801.5	1801.5	3078	1800.25
NQ05MIR	5	12/11/2009	1005	1801.75	1802.5	1799.25	1800.25	3482	1799
NQ05MIR	5	12/11/2009	1010	1800.25	1802	1799.25	1800.5	4871	1799.25
NQ05MIR	5	12/11/2009	1015	1800.25	1800.25	1796.5	1799.5	3541	1798.25
NQ05MIR	5	12/11/2009	1020	1799.5	1799.75	1796.25	1797.25	4677	1796
NQ05MIR	5	12/11/2009	1025	1797.25	1799.5	1797	1799.25	1750	1798
NQ05MIR	5	12/11/2009	1030	1799	1801.5	1798.25	1800.25	3359	1799
NQ05MIR	5	12/11/2009	1035	1800	1801.5	1799	1800.25	2890	1799
NQ05MIR	5	12/11/2009	1040	1800.25	1800.25	1798.25	1799.5	998	1798.25
NQ05MIR	5	12/11/2009	1045	1799.25	1800.25	1798.75	1799	1204	1797.75
NQ05MIR	5	12/11/2009	1050	1799.25	1800.75	1798.75	1800.25	1334	1799
NQ05MIR	5	12/11/2009	1055	1800.5	1802.25	1799.5	1799.5	2097	1798.25
NQ05MIR	5	12/11/2009	1100	1799.5	1799.75	1796.75	1797	2222	1795.75
NQ05MIR	5	12/11/2009	1105	1797	1797.5	1795	1795.25	2549	1794
NQ05MIR	5	12/11/2009	1110	1795	1795.5	1794.25	1794.5	2125	1793.25
NQ05MIR	5	12/11/2009	1115	1794.5	1796.5	1794.25	1794.5	2762	1793.25
NQ05MIR	5	12/11/2009	1120	1794.25	1794.25	1787.25	1787.5	7489	1786.25
NQ05MIR	5	12/11/2009	1125	1787.75	1788.75	1785.5	1787.25	7740	1786
NQ05MIR	5	12/11/2009	1130	1787.25	1787.5	1785	1787.25	5214	1786
NQ05MIR	5	12/11/2009	1135	1787	1788	1785.5	1787.5	3377	1786.25
NQ05MIR	5	12/11/2009	1140	1787.5	1787.5	1785	1786	3201	1784.75
NQ05MIR	5	12/11/2009	1145	1786	1786	1782.5	1783.75	7228	1782.5
NQ05MIR	5	12/11/2009	1150	1783.75	1785.25	1783	1785	2676	1783.75
NQ05MIR	5	12/11/2009	1155	1785	1785.5	1783.25	1785.25	2574	1784
NQ05MIR	5	12/11/2009	1200	1785	1786.5	1785	1785.25	1453	1784
NQ05MIR	5	12/11/2009	1205	1785.5	1787	1785.25	1786.75	1534	1785.5
NQ05MIR	5	12/11/2009	1210	1786.75	1788	1786.5	1787	1904	1785.75
NQ05MIR	5	12/11/2009	1215	1786.75	1788	1786.75	1787	725	1785.75
NQ05MIR	5	12/11/2009	1220	1787.25	1787.75	1786.25	1786.25	2027	1785
NQ05MIR	5	12/11/2009	1225	1786.25	1787	1786	1786.75	1330	1785.5
NQ05MIR	5	12/11/2009	1230	1786.5	1787.5	1786	1787	2299	1785.75
NQ05MIR	5	12/11/2009	1235	1787.25	1788	1786.5	1787.75	725	1786.5
NQ05MIR	5	12/11/2009	1240	1787.75	1787.75	1787	1787.25	683	1786
NQ05MIR	5	12/11/2009	1245	1787.5	1787.5	1786.25	1786.75	2899	1785.5
NQ05MIR	5	12/11/2009	1250	1786.5	1790.5	1786.5	1790.25	2310	1789
NQ05MIR	5	12/11/2009	1255	1790.5	1791.75	1790	1791.25	1971	1790
NQ05MIR	5	12/11/2009	1300	1791.5	1792.5	1791.25	1791.25	1015	1790
NQ05MIR	5	12/11/2009	1305	1791	1791.25	1790.5	1790.75	800	1789.5
NQ05MIR	5	12/11/2009	1310	1790.75	1791.25	1790.25	1790.5	596	1789.25
NQ05MIR	5	12/11/2009	1315	1790.25	1791	1789.75	1790.25	774	1789
NQ05MIR	5	12/11/2009	1320	1790.25	1790.75	1790	1790.25	574	1789
NQ05MIR	5	12/11/2009	1325	1790	1790.25	1789	1789.5	728	1788.25
NQ05MIR	5	12/11/2009	1330	1789.75	1790.25	1789	1789.5	602	1788.25
NQ05MIR	5	12/11/2009	1335	1789.5	1790.75	1789.25	1790.75	691	1789.5
NQ05MIR	5	12/11/2009	1340	1790.75	1791	1790	1790	936	1788.75
NQ05MIR	5	12/11/2009	1345	1790	1790.25	1789.25	1789.5	737	1788.25
NQ05MIR	5	12/11/2009	1350	1789.25	1790	1788.75	1789	765	1787.75
NQ05MIR	5	12/11/2009	1355	1789	1790.5	1788.75	1790	860	1788.75
NQ05MIR	5	12/11/2009	1400	1790	1791.25	1789.25	1790	2121	1788.75
NQ05MIR	5	12/11/2009	1405	1789.75	1792.5	1789.75	1792	1949	1790.75
NQ05MIR	5	12/11/2009	1410	1791.75	1792.5	1791.5	1791.75	1130	1790.5
NQ05MIR	5	12/11/2009	1415	1791.75	1791.75	1791	1791	521	1789.75
NQ05MIR	5	12/11/2009	1420	1791	1792	1790.75	1791.25	1115	1790
NQ05MIR	5	12/11/2009	1425	1791	1791.5	1790.5	1791	933	1789.75
NQ05MIR	5	12/11/2009	1430	1791	1791.5	1790	1790	1180	1788.75
NQ05MIR	5	12/11/2009	1435	1790	1790	1788.5	1789	849	1787.75
NQ05MIR	5	12/11/2009	1440	1789	1790	1788	1789.25	1923	1788
NQ05MIR	5	12/11/2009	1445	1789.25	1791	1789.25	1789.75	1078	1788.5
NQ05MIR	5	12/11/2009	1450	1789.5	1790.75	1789.5	1789.75	1168	1788.5
NQ05MIR	5	12/11/2009	1455	1789.75	1790.75	1789	1789.25	1639	1788
NQ05MIR	5	12/11/2009	1500	1789	1790	1788.5	1790	1012	1788.75
NQ05MIR	5	12/11/2009	1505	1790	1790.25	1789.5	1789.5	574	1788.25
NQ05MIR	5	12/11/2009	1510	1789.75	1791.25	1789.25	1791	1284	1789.75
NQ05MIR	5	12/11/2009	1515	1791	1791	1789.75	1790	756	1788.75
NQ05MIR	5	12/11/2009	1520	1789.75	1791.25	1789	1790.5	1323	1789.25
NQ05MIR	5	12/11/2009	1525	1790.75	1793.25	1790.75	1793	2501	1791.75
NQ05MIR	5	12/11/2009	1530	1793	1794	1792.25	1793	2677	1791.75

What does your program do?

Could you resend two files:
1st good file that process ok
2nd bad file that crashes

the program reads in the data from the txt file, then it does some analysis on the data in the main function, outputting to a txt file. Then there is more analysis i.e., the moving average function (which i posted above) which also outputs to a txt file, the "MA.txt" (see code above). When I try the 5 min data, and check the 2 output files, the first one is good but the 2nd txt file, i.e., the MA.txt doesn't generate at all. Could that be the source of the abort? It does when I try the 1 min data.

I'm reattaching both files. The first one is 1 min data in the "csv file.txt". The second is 5 min data in the "five09.txt". Both files end with newlines as far as I can tell. I just tried again, and verified again that the 1 min data file is working as expected, no aborts there. But the 5 min isn't working.

Edited 1 Year Ago by toneranger

Attachments
NQ01MIR	1	12/10/2009	930	1794.25	1799.5	1794	1799	1873	1797.75
NQ01MIR	1	12/10/2009	931	1799	1801	1798.5	1800.5	1004	1799.25
NQ01MIR	1	12/10/2009	932	1800.75	1801	1800	1800.75	647	1799.5
NQ01MIR	1	12/10/2009	933	1800.75	1802	1800.5	1801.5	657	1800.25
NQ01MIR	1	12/10/2009	934	1801.75	1803.25	1801.75	1802	843	1800.75
NQ01MIR	1	12/10/2009	935	1802	1803.75	1801.25	1803.25	1084	1802
NQ01MIR	1	12/10/2009	936	1803.25	1806.75	1803.25	1806	1308	1804.75
NQ01MIR	1	12/10/2009	937	1806	1806	1804.5	1805	755	1803.75
NQ01MIR	1	12/10/2009	938	1805	1805.75	1803.75	1803.75	481	1802.5
NQ01MIR	1	12/10/2009	939	1803.75	1805.5	1803.25	1804	1038	1802.75
NQ01MIR	1	12/10/2009	940	1804	1805.5	1804	1805	1049	1803.75
NQ01MIR	1	12/10/2009	941	1805	1805	1804	1804.25	375	1803
NQ01MIR	1	12/10/2009	942	1804	1806.25	1803.75	1805.25	1323	1804
NQ01MIR	1	12/10/2009	943	1805.25	1805.75	1805.25	1805.5	375	1804.25
NQ01MIR	1	12/10/2009	944	1805.25	1805.5	1804.75	1805	511	1803.75
NQ01MIR	1	12/10/2009	945	1805	1805.75	1804.5	1804.5	871	1803.25
NQ01MIR	1	12/10/2009	946	1804.5	1805.5	1803.75	1804	1104	1802.75
NQ01MIR	1	12/10/2009	947	1804	1804.75	1803.75	1804.5	364	1803.25
NQ01MIR	1	12/10/2009	948	1804.75	1805.25	1803.75	1804	429	1802.75
NQ01MIR	1	12/10/2009	949	1804	1804.5	1803.75	1804	147	1802.75
NQ01MIR	1	12/10/2009	950	1804	1804	1802	1802.25	761	1801
NQ01MIR	1	12/10/2009	951	1802.5	1802.5	1801	1801	393	1799.75
NQ01MIR	1	12/10/2009	952	1801.25	1802	1800.5	1802	350	1800.75
NQ01MIR	1	12/10/2009	953	1802	1802	1799	1799.5	495	1798.25
NQ01MIR	1	12/10/2009	954	1799.5	1800.75	1799.25	1799.75	434	1798.5
NQ01MIR	1	12/10/2009	955	1800	1801.25	1800	1800.75	450	1799.5
NQ01MIR	1	12/10/2009	956	1800.75	1800.75	1799.75	1799.75	128	1798.5
NQ01MIR	1	12/10/2009	957	1799.5	1801	1799.5	1800.5	444	1799.25
NQ01MIR	1	12/10/2009	958	1800.5	1802	1800.5	1801.75	270	1800.5
NQ01MIR	1	12/10/2009	959	1801.75	1802.25	1799.75	1799.75	129	1798.5
NQ01MIR	1	12/10/2009	1000	1800	1800.75	1799.75	1800	270	1798.75
NQ01MIR	1	12/10/2009	1001	1800	1800	1799	1799.25	152	1798
NQ01MIR	1	12/10/2009	1002	1799.25	1799.25	1798.25	1798.25	167	1797
NQ01MIR	1	12/10/2009	1003	1798.25	1799.5	1797.5	1799.5	657	1798.25
NQ01MIR	1	12/10/2009	1004	1799.5	1799.5	1798.75	1799	312	1797.75
NQ01MIR	1	12/10/2009	1005	1799	1799.25	1797.5	1798	971	1796.75
NQ01MIR	1	12/10/2009	1006	1797.75	1798.5	1797.75	1798	293	1796.75
NQ01MIR	1	12/10/2009	1007	1798	1801.25	1797.75	1801	819	1799.75
NQ01MIR	1	12/10/2009	1008	1800.75	1801	1799.75	1800.5	373	1799.25
NQ01MIR	1	12/10/2009	1009	1800.75	1800.75	1800	1800.25	227	1799
NQ01MIR	1	12/10/2009	1010	1800.5	1801.5	1800.25	1801.25	431	1800
NQ01MIR	1	12/10/2009	1011	1801.25	1801.5	1800	1800.25	385	1799
NQ01MIR	1	12/10/2009	1012	1800	1800	1798.25	1798.25	353	1797
NQ01MIR	1	12/10/2009	1013	1798.5	1800.75	1798.5	1800.75	532	1799.5
NQ01MIR	1	12/10/2009	1014	1800.5	1800.75	1800	1800.25	212	1799
NQ01MIR	1	12/10/2009	1015	1800.25	1801.75	1800	1801.5	308	1800.25
NQ01MIR	1	12/10/2009	1016	1801.5	1802.25	1801.25	1802.25	618	1801
NQ01MIR	1	12/10/2009	1017	1802	1802.25	1800.75	1801.75	629	1800.5
NQ01MIR	1	12/10/2009	1018	1801.75	1801.75	1800.25	1800.25	235	1799
NQ01MIR	1	12/10/2009	1019	1800.25	1800.25	1799.5	1799.75	763	1798.5
NQ01MIR	1	12/10/2009	1020	1799.75	1800	1799.25	1800	1491	1798.75
NQ01MIR	1	12/10/2009	1021	1800.25	1800.75	1799.25	1800.25	302	1799
NQ01MIR	1	12/10/2009	1022	1800.25	1801.25	1800.25	1801.25	292	1800
NQ01MIR	1	12/10/2009	1023	1801.25	1802	1801	1801.75	188	1800.5
NQ01MIR	1	12/10/2009	1024	1801.75	1802.25	1801.75	1802.25	195	1801
NQ01MIR	1	12/10/2009	1025	1802	1802	1801	1801.5	451	1800.25
NQ01MIR	1	12/10/2009	1026	1801.75	1802.75	1801.75	1802.25	719	1801
NQ01MIR	1	12/10/2009	1027	1802.5	1804.75	1802.5	1804.75	534	1803.5
NQ01MIR	1	12/10/2009	1028	1804.75	1804.75	1803.5	1804	592	1802.75
NQ01MIR	1	12/10/2009	1029	1804	1804	1803	1803.25	298	1802
NQ01MIR	1	12/10/2009	1030	1803.25	1804.5	1802.5	1802.5	532	1801.25
NQ01MIR	1	12/10/2009	1031	1802.75	1804.5	1802.75	1803.25	731	1802
NQ01MIR	1	12/10/2009	1032	1803.25	1804	1803	1803	695	1801.75
NQ01MIR	1	12/10/2009	1033	1803.25	1804	1802.25	1802.5	744	1801.25
NQ01MIR	1	12/10/2009	1034	1802.75	1802.75	1802	1802.5	150	1801.25
NQ01MIR	1	12/10/2009	1035	1802.5	1802.75	1802	1802.25	152	1801
NQ01MIR	1	12/10/2009	1036	1802.25	1802.25	1801.25	1801.25	151	1800
NQ01MIR	1	12/10/2009	1037	1801.25	1801.75	1800.5	1800.75	247	1799.5
NQ01MIR	1	12/10/2009	1038	1801	1802.25	1800.75	1802	315	1800.75
NQ01MIR	1	12/10/2009	1039	1802	1802.75	1801.25	1802	538	1800.75
NQ01MIR	1	12/10/2009	1040	1802	1802.75	1801.5	1802.75	255	1801.5
NQ01MIR	1	12/10/2009	1041	1802.75	1803.75	1802.5	1803.75	299	1802.5
NQ01MIR	1	12/10/2009	1042	1803.5	1803.5	1802	1802.25	455	1801
NQ01MIR	1	12/10/2009	1043	1802.25	1802.75	1802.25	1802.25	321	1801
NQ01MIR	1	12/10/2009	1044	1802.25	1802.25	1801	1801.25	269	1800
NQ01MIR	1	12/10/2009	1045	1801.25	1801.5	1800.25	1800.75	258	1799.5
NQ01MIR	1	12/10/2009	1046	1800.75	1801.75	1800.25	1801.75	297	1800.5
NQ01MIR	1	12/10/2009	1047	1801.5	1801.5	1801	1801	124	1799.75
NQ01MIR	1	12/10/2009	1048	1800.75	1802.5	1800.75	1802.5	108	1801.25
NQ01MIR	1	12/10/2009	1049	1802.5	1802.5	1801.25	1801.25	268	1800
NQ01MIR	1	12/10/2009	1050	1801.5	1801.75	1801	1801.75	220	1800.5
NQ01MIR	1	12/10/2009	1051	1802	1802.25	1800.75	1800.75	147	1799.5
NQ01MIR	1	12/10/2009	1052	1801	1801.5	1800.75	1801.5	174	1800.25
NQ01MIR	1	12/10/2009	1053	1801.5	1802.25	1801.25	1801.25	286	1800
NQ01MIR	1	12/10/2009	1054	1801.25	1801.75	1800.75	1801.25	218	1800
NQ01MIR	1	12/10/2009	1055	1801	1802.25	1800.5	1801.25	513	1800
NQ01MIR	1	12/10/2009	1056	1801	1801.75	1800.75	1801.75	156	1800.5
NQ01MIR	1	12/10/2009	1057	1801.5	1803	1801.5	1801.75	466	1800.5
NQ01MIR	1	12/10/2009	1058	1801.75	1802	1801.5	1801.75	76	1800.5
NQ01MIR	1	12/10/2009	1059	1801.75	1802.5	1801.75	1802.25	134	1801
NQ01MIR	1	12/10/2009	1100	1802.25	1802.25	1801.5	1801.5	113	1800.25
NQ01MIR	1	12/10/2009	1101	1801.5	1802.25	1801.5	1801.5	117	1800.25
NQ01MIR	1	12/10/2009	1102	1801.75	1801.75	1801.25	1801.5	72	1800.25
NQ01MIR	1	12/10/2009	1103	1801.25	1801.75	1801.25	1801.75	127	1800.5
NQ01MIR	1	12/10/2009	1104	1802	1803.25	1802	1803.25	278	1802
NQ01MIR	1	12/10/2009	1105	1803.5	1803.75	1803.25	1803.25	446	1802
NQ01MIR	1	12/10/2009	1106	1803.25	1803.25	1802.25	1802.5	293	1801.25
NQ01MIR	1	12/10/2009	1107	1802.25	1802.75	1802.25	1802.25	277	1801
NQ01MIR	1	12/10/2009	1108	1802.25	1802.5	1802	1802.5	75	1801.25
NQ01MIR	1	12/10/2009	1109	1802.25	1802.75	1802.25	1802.75	105	1801.5
NQ01MIR	1	12/10/2009	1110	1802.75	1803	1802.5	1802.75	264	1801.5
NQ01MIR	1	12/10/2009	1111	1802.75	1802.75	1801.75	1801.75	221	1800.5
NQ01MIR	1	12/10/2009	1112	1801.5	1802.5	1801.5	1802.5	715	1801.25
NQ01MIR	1	12/10/2009	1113	1802.5	1803.5	1802.5	1803.5	524	1802.25
NQ01MIR	1	12/10/2009	1114	1803.5	1803.75	1802.75	1802.75	368	1801.5
NQ01MIR	1	12/10/2009	1115	1802.75	1805	1802.75	1804.25	523	1803
NQ01MIR	1	12/10/2009	1116	1804.25	1804.75	1804	1804.5	260	1803.25
NQ01MIR	1	12/10/2009	1117	1804.5	1805.25	1804.5	1805	472	1803.75
NQ01MIR	1	12/10/2009	1118	1805	1805	1804	1804.25	186	1803
NQ01MIR	1	12/10/2009	1119	1804.5	1804.5	1804	1804.25	406	1803
NQ01MIR	1	12/10/2009	1120	1804.25	1804.5	1803.5	1803.5	769	1802.25
NQ01MIR	1	12/10/2009	1121	1803.75	1804	1803.75	1804	226	1802.75
NQ01MIR	1	12/10/2009	1122	1804	1804	1803	1803	196	1801.75
NQ01MIR	1	12/10/2009	1123	1803.25	1803.75	1803	1803.5	214	1802.25
NQ01MIR	1	12/10/2009	1124	1803.25	1803.5	1803	1803.5	167	1802.25
NQ01MIR	1	12/10/2009	1125	1803.5	1804	1803.5	1803.5	212	1802.25
NQ01MIR	1	12/10/2009	1126	1803.25	1803.25	1802.25	1803	490	1801.75
NQ01MIR	1	12/10/2009	1127	1803.25	1804.75	1803.25	1803.25	528	1802
NQ01MIR	1	12/10/2009	1128	1803.5	1804.25	1802.75	1803.5	221	1802.25
NQ01MIR	1	12/10/2009	1129	1803.5	1803.75	1802.5	1803.25	506	1802
NQ01MIR	1	12/10/2009	1130	1803.25	1803.25	1803	1803	81	1801.75
NQ01MIR	1	12/10/2009	1131	1803.25	1803.75	1802.75	1803.75	178	1802.5
NQ01MIR	1	12/10/2009	1132	1803.75	1805	1803.25	1805	781	1803.75
NQ01MIR	1	12/10/2009	1133	1804.75	1805.25	1804.5	1805.25	503	1804
NQ01MIR	1	12/10/2009	1134	1805.25	1805.25	1803.5	1803.5	202	1802.25
NQ01MIR	1	12/10/2009	1135	1803.5	1804	1802.75	1803.5	425	1802.25
NQ01MIR	1	12/10/2009	1136	1803.25	1804.25	1803.25	1804.25	242	1803
NQ01MIR	1	12/10/2009	1137	1804	1804.25	1803	1803.25	636	1802
NQ01MIR	1	12/10/2009	1138	1803.25	1804	1802.75	1804	267	1802.75
NQ01MIR	1	12/10/2009	1139	1803.75	1803.75	1803.25	1803.5	125	1802.25
NQ01MIR	1	12/10/2009	1140	1803.75	1803.75	1802.75	1802.75	134	1801.5
NQ01MIR	1	12/10/2009	1141	1802.75	1803	1802.75	1802.75	72	1801.5
NQ01MIR	1	12/10/2009	1142	1802.75	1803.75	1802.5	1803.75	525	1802.5
NQ01MIR	1	12/10/2009	1143	1803.75	1803.75	1802.25	1802.5	212	1801.25
NQ01MIR	1	12/10/2009	1144	1802.5	1803.25	1802.25	1802.25	317	1801
NQ01MIR	1	12/10/2009	1145	1802.25	1802.75	1801.75	1802.5	287	1801.25
NQ01MIR	1	12/10/2009	1146	1802.5	1802.5	1802.25	1802.5	75	1801.25
NQ01MIR	1	12/10/2009	1147	1802.5	1802.5	1802	1802.5	215	1801.25
NQ01MIR	1	12/10/2009	1148	1802.5	1802.75	1802.25	1802.75	73	1801.5
NQ01MIR	1	12/10/2009	1149	1802.75	1803.5	1802.25	1803.5	318	1802.25
NQ01MIR	1	12/10/2009	1150	1803.25	1803.25	1802.5	1802.75	222	1801.5
NQ01MIR	1	12/10/2009	1151	1802.75	1802.75	1802	1802.25	156	1801
NQ01MIR	1	12/10/2009	1152	1802.5	1802.5	1801.25	1802.5	357	1801.25
NQ01MIR	1	12/10/2009	1153	1802.25	1802.25	1801.75	1801.75	124	1800.5
NQ01MIR	1	12/10/2009	1154	1802	1802.75	1802	1802.5	177	1801.25
NQ01MIR	1	12/10/2009	1155	1802.25	1802.5	1802	1802.25	185	1801
NQ01MIR	1	12/10/2009	1156	1802.25	1802.25	1801.75	1801.75	175	1800.5
NQ01MIR	1	12/10/2009	1157	1802	1802.25	1802	1802	86	1800.75
NQ01MIR	1	12/10/2009	1158	1802	1802.25	1802	1802	103	1800.75
NQ01MIR	1	12/10/2009	1159	1802	1803	1801.75	1801.75	275	1800.5
NQ01MIR	1	12/10/2009	1200	1801.75	1802.25	1801.5	1802	99	1800.75
NQ01MIR	1	12/10/2009	1201	1802	1802.5	1802	1802.25	135	1801
NQ01MIR	1	12/10/2009	1202	1802.25	1802.5	1801.75	1802.5	119	1801.25
NQ01MIR	1	12/10/2009	1203	1802.25	1802.5	1801.75	1802	198	1800.75
NQ01MIR	1	12/10/2009	1204	1802	1803	1802	1803	302	1801.75
NQ01MIR	1	12/10/2
NQ05MIR	5	12/10/2009	930	1794.25	1803.25	1794	1802	5024	1800.75
NQ05MIR	5	12/10/2009	935	1802	1806.75	1801.25	1804	4666	1802.75
NQ05MIR	5	12/10/2009	940	1804	1806.25	1803.75	1805	3633	1803.75
NQ05MIR	5	12/10/2009	945	1805	1805.75	1803.75	1804	2915	1802.75
NQ05MIR	5	12/10/2009	950	1804	1804	1799	1799.75	2433	1798.5
NQ05MIR	5	12/10/2009	955	1800	1802.25	1799.5	1799.75	1421	1798.5
NQ05MIR	5	12/10/2009	1000	1800	1800.75	1797.5	1799	1558	1797.75
NQ05MIR	5	12/10/2009	1005	1799	1801.25	1797.5	1800.25	2683	1799
NQ05MIR	5	12/10/2009	1010	1800.5	1801.5	1798.25	1800.25	1913	1799
NQ05MIR	5	12/10/2009	1015	1800.25	1802.25	1799.5	1799.75	2553	1798.5
NQ05MIR	5	12/10/2009	1020	1799.75	1802.25	1799.25	1802.25	2468	1801
NQ05MIR	5	12/10/2009	1025	1802	1804.75	1801	1803.25	2594	1802
NQ05MIR	5	12/10/2009	1030	1803.25	1804.5	1802	1802.5	2852	1801.25
NQ05MIR	5	12/10/2009	1035	1802.5	1802.75	1800.5	1802	1403	1800.75
NQ05MIR	5	12/10/2009	1040	1802	1803.75	1801	1801.25	1599	1800
NQ05MIR	5	12/10/2009	1045	1801.25	1802.5	1800.25	1801.25	1055	1800
NQ05MIR	5	12/10/2009	1050	1801.5	1802.25	1800.75	1801.25	1045	1800
NQ05MIR	5	12/10/2009	1055	1801	1803	1800.5	1802.25	1345	1801
NQ05MIR	5	12/10/2009	1100	1802.25	1803.25	1801.25	1803.25	707	1802
NQ05MIR	5	12/10/2009	1105	1803.5	1803.75	1802	1802.75	1196	1801.5
NQ05MIR	5	12/10/2009	1110	1802.75	1803.75	1801.5	1802.75	2092	1801.5
NQ05MIR	5	12/10/2009	1115	1802.75	1805.25	1802.75	1804.25	1847	1803
NQ05MIR	5	12/10/2009	1120	1804.25	1804.5	1803	1803.5	1572	1802.25
NQ05MIR	5	12/10/2009	1125	1803.5	1804.75	1802.25	1803.25	1957	1802
NQ05MIR	5	12/10/2009	1130	1803.25	1805.25	1802.75	1803.5	1745	1802.25
NQ05MIR	5	12/10/2009	1135	1803.5	1804.25	1802.75	1803.5	1695	1802.25
NQ05MIR	5	12/10/2009	1140	1803.75	1803.75	1802.25	1802.25	1260	1801
NQ05MIR	5	12/10/2009	1145	1802.25	1803.5	1801.75	1803.5	968	1802.25
NQ05MIR	5	12/10/2009	1150	1803.25	1803.25	1801.25	1802.5	1036	1801.25
NQ05MIR	5	12/10/2009	1155	1802.25	1803	1801.75	1801.75	824	1800.5
NQ05MIR	5	12/10/2009	1200	1801.75	1803	1801.5	1803	853	1801.75
NQ05MIR	5	12/10/2009	1205	1803	1804.25	1801.75	1802.75	2528	1801.5
NQ05MIR	5	12/10/2009	1210	1802.75	1803	1801.25	1801.25	1918	1800
NQ05MIR	5	12/10/2009	1215	1801	1802.75	1800.75	1802.75	1546	1801.5
NQ05MIR	5	12/10/2009	1220	1802.5	1802.5	1801.25	1801.75	836	1800.5
NQ05MIR	5	12/10/2009	1225	1801.75	1802.25	1801.25	1801.75	555	1800.5
NQ05MIR	5	12/10/2009	1230	1801.5	1802	1800.75	1801.75	1060	1800.5
NQ05MIR	5	12/10/2009	1235	1801.75	1801.75	1800.75	1801.25	1137	1800
NQ05MIR	5	12/10/2009	1240	1801.25	1802.5	1801	1802.25	1277	1801
NQ05MIR	5	12/10/2009	1245	1802.25	1804.25	1802.25	1804	1011	1802.75
NQ05MIR	5	12/10/2009	1250	1803.75	1804.5	1803.75	1804	533	1802.75
NQ05MIR	5	12/10/2009	1255	1804	1804.75	1803.75	1804.75	380	1803.5
NQ05MIR	5	12/10/2009	1300	1804.5	1804.75	1801.5	1802.25	1683	1801
NQ05MIR	5	12/10/2009	1305	1802.25	1803.5	1799.5	1799.75	1324	1798.5
NQ05MIR	5	12/10/2009	1310	1799.75	1800.25	1797	1797.5	2001	1796.25
NQ05MIR	5	12/10/2009	1315	1797.5	1799	1797	1797.5	1476	1796.25
NQ05MIR	5	12/10/2009	1320	1797.5	1799.25	1797	1798.5	1354	1797.25
NQ05MIR	5	12/10/2009	1325	1798.5	1799.5	1798.5	1799.25	795	1798
NQ05MIR	5	12/10/2009	1330	1799.25	1800.5	1799.25	1800	801	1798.75
NQ05MIR	5	12/10/2009	1335	1799.75	1801.5	1799.25	1801.5	863	1800.25
NQ05MIR	5	12/10/2009	1340	1801.5	1802	1800	1801.5	768	1800.25
NQ05MIR	5	12/10/2009	1345	1801.5	1801.5	1799.75	1801	299	1799.75
NQ05MIR	5	12/10/2009	1350	1801	1801.25	1799.75	1799.75	352	1798.5
NQ05MIR	5	12/10/2009	1355	1799.75	1801.5	1799.5	1801.25	474	1800
NQ05MIR	5	12/10/2009	1400	1801.25	1801.25	1800	1801.25	515	1800
NQ05MIR	5	12/10/2009	1405	1801.25	1802.5	1801.25	1801.75	900	1800.5
NQ05MIR	5	12/10/2009	1410	1801.75	1801.75	1800.75	1801.75	829	1800.5
NQ05MIR	5	12/10/2009	1415	1802	1803.25	1801.75	1803.25	808	1802
NQ05MIR	5	12/10/2009	1420	1803.25	1803.5	1802.25	1802.25	949	1801
NQ05MIR	5	12/10/2009	1425	1802.25	1803.25	1802.25	1802.75	975	1801.5
NQ05MIR	5	12/10/2009	1430	1802.75	1803.75	1802.75	1803.25	372	1802
NQ05MIR	5	12/10/2009	1435	1803.25	1803.25	1802	1802.5	449	1801.25
NQ05MIR	5	12/10/2009	1440	1802.5	1802.5	1800.25	1801	1235	1799.75
NQ05MIR	5	12/10/2009	1445	1801	1802.75	1801	1801.75	1030	1800.5
NQ05MIR	5	12/10/2009	1450	1802	1802	1801	1802	862	1800.75
NQ05MIR	5	12/10/2009	1455	1802	1802	1801.25	1801.75	372	1800.5
NQ05MIR	5	12/10/2009	1500	1801.75	1802	1800.25	1800.25	895	1799
NQ05MIR	5	12/10/2009	1505	1800.25	1801.75	1799.75	1800.5	1322	1799.25
NQ05MIR	5	12/10/2009	1510	1800.25	1803	1800.25	1801.5	867	1800.25
NQ05MIR	5	12/10/2009	1515	1801.5	1802.25	1800.75	1801	463	1799.75
NQ05MIR	5	12/10/2009	1520	1800.75	1800.75	1798.75	1798.75	815	1797.5
NQ05MIR	5	12/10/2009	1525	1798.75	1799.25	1796	1796.5	1739	1795.25
NQ05MIR	5	12/10/2009	1530	1796.5	1797.25	1795	1796	1545	1794.75
NQ05MIR	5	12/10/2009	1535	1796	1797.75	1795.75	1797.5	1059	1796.25
NQ05MIR	5	12/10/2009	1540	1797.5	1798	1796.5	1797.75	1026	1796.5
NQ05MIR	5	12/10/2009	1545	1797.75	1799.5	1797.25	1799.25	1015	1798
NQ05MIR	5	12/10/2009	1550	1799.25	1799.5	1796.75	1797.75	1868	1796.5
NQ05MIR	5	12/10/2009	1555	1797.75	1798.25	1796.25	1796.25	5325	1795
NQ05MIR	5	12/10/2009	1600	1796.5	1798.5	1796	1797.75	2151	1796.5
NQ05MIR	5	12/10/2009	1605	1798	1798.5	1797.75	1798.5	886	1797.25
NQ05MIR	5	12/10/2009	1610	1798.25	1798.75	1796.75	1798.25	2073	1797
NQ05MIR	5	12/11/2009	930	1805.75	1808.75	1803	1803	4448	1801.75
NQ05MIR	5	12/11/2009	935	1803	1805	1802.25	1804	4006	1802.75
NQ05MIR	5	12/11/2009	940	1803.75	1806	1803.25	1803.25	3357	1802
NQ05MIR	5	12/11/2009	945	1803.5	1805	1800.5	1800.75	3566	1799.5
NQ05MIR	5	12/11/2009	950	1800.75	1804.5	1797.75	1803.75	6303	1802.5
NQ05MIR	5	12/11/2009	955	1804	1807.75	1799.75	1804.75	7899	1803.5
NQ05MIR	5	12/11/2009	1000	1805.25	1805.75	1801.5	1801.5	3078	1800.25
NQ05MIR	5	12/11/2009	1005	1801.75	1802.5	1799.25	1800.25	3482	1799
NQ05MIR	5	12/11/2009	1010	1800.25	1802	1799.25	1800.5	4871	1799.25
NQ05MIR	5	12/11/2009	1015	1800.25	1800.25	1796.5	1799.5	3541	1798.25
NQ05MIR	5	12/11/2009	1020	1799.5	1799.75	1796.25	1797.25	4677	1796
NQ05MIR	5	12/11/2009	1025	1797.25	1799.5	1797	1799.25	1750	1798
NQ05MIR	5	12/11/2009	1030	1799	1801.5	1798.25	1800.25	3359	1799
NQ05MIR	5	12/11/2009	1035	1800	1801.5	1799	1800.25	2890	1799
NQ05MIR	5	12/11/2009	1040	1800.25	1800.25	1798.25	1799.5	998	1798.25
NQ05MIR	5	12/11/2009	1045	1799.25	1800.25	1798.75	1799	1204	1797.75
NQ05MIR	5	12/11/2009	1050	1799.25	1800.75	1798.75	1800.25	1334	1799
NQ05MIR	5	12/11/2009	1055	1800.5	1802.25	1799.5	1799.5	2097	1798.25
NQ05MIR	5	12/11/2009	1100	1799.5	1799.75	1796.75	1797	2222	1795.75
NQ05MIR	5	12/11/2009	1105	1797	1797.5	1795	1795.25	2549	1794
NQ05MIR	5	12/11/2009	1110	1795	1795.5	1794.25	1794.5	2125	1793.25
NQ05MIR	5	12/11/2009	1115	1794.5	1796.5	1794.25	1794.5	2762	1793.25
NQ05MIR	5	12/11/2009	1120	1794.25	1794.25	1787.25	1787.5	7489	1786.25
NQ05MIR	5	12/11/2009	1125	1787.75	1788.75	1785.5	1787.25	7740	1786
NQ05MIR	5	12/11/2009	1130	1787.25	1787.5	1785	1787.25	5214	1786
NQ05MIR	5	12/11/2009	1135	1787	1788	1785.5	1787.5	3377	1786.25
NQ05MIR	5	12/11/2009	1140	1787.5	1787.5	1785	1786	3201	1784.75
NQ05MIR	5	12/11/2009	1145	1786	1786	1782.5	1783.75	7228	1782.5
NQ05MIR	5	12/11/2009	1150	1783.75	1785.25	1783	1785	2676	1783.75
NQ05MIR	5	12/11/2009	1155	1785	1785.5	1783.25	1785.25	2574	1784
NQ05MIR	5	12/11/2009	1200	1785	1786.5	1785	1785.25	1453	1784
NQ05MIR	5	12/11/2009	1205	1785.5	1787	1785.25	1786.75	1534	1785.5
NQ05MIR	5	12/11/2009	1210	1786.75	1788	1786.5	1787	1904	1785.75
NQ05MIR	5	12/11/2009	1215	1786.75	1788	1786.75	1787	725	1785.75
NQ05MIR	5	12/11/2009	1220	1787.25	1787.75	1786.25	1786.25	2027	1785
NQ05MIR	5	12/11/2009	1225	1786.25	1787	1786	1786.75	1330	1785.5
NQ05MIR	5	12/11/2009	1230	1786.5	1787.5	1786	1787	2299	1785.75
NQ05MIR	5	12/11/2009	1235	1787.25	1788	1786.5	1787.75	725	1786.5
NQ05MIR	5	12/11/2009	1240	1787.75	1787.75	1787	1787.25	683	1786
NQ05MIR	5	12/11/2009	1245	1787.5	1787.5	1786.25	1786.75	2899	1785.5
NQ05MIR	5	12/11/2009	1250	1786.5	1790.5	1786.5	1790.25	2310	1789
NQ05MIR	5	12/11/2009	1255	1790.5	1791.75	1790	1791.25	1971	1790
NQ05MIR	5	12/11/2009	1300	1791.5	1792.5	1791.25	1791.25	1015	1790
NQ05MIR	5	12/11/2009	1305	1791	1791.25	1790.5	1790.75	800	1789.5
NQ05MIR	5	12/11/2009	1310	1790.75	1791.25	1790.25	1790.5	596	1789.25
NQ05MIR	5	12/11/2009	1315	1790.25	1791	1789.75	1790.25	774	1789
NQ05MIR	5	12/11/2009	1320	1790.25	1790.75	1790	1790.25	574	1789
NQ05MIR	5	12/11/2009	1325	1790	1790.25	1789	1789.5	728	1788.25
NQ05MIR	5	12/11/2009	1330	1789.75	1790.25	1789	1789.5	602	1788.25
NQ05MIR	5	12/11/2009	1335	1789.5	1790.75	1789.25	1790.75	691	1789.5
NQ05MIR	5	12/11/2009	1340	1790.75	1791	1790	1790	936	1788.75
NQ05MIR	5	12/11/2009	1345	1790	1790.25	1789.25	1789.5	737	1788.25
NQ05MIR	5	12/11/2009	1350	1789.25	1790	1788.75	1789	765	1787.75
NQ05MIR	5	12/11/2009	1355	1789	1790.5	1788.75	1790	860	1788.75
NQ05MIR	5	12/11/2009	1400	1790	1791.25	1789.25	1790	2121	1788.75
NQ05MIR	5	12/11/2009	1405	1789.75	1792.5	1789.75	1792	1949	1790.75
NQ05MIR	5	12/11/2009	1410	1791.75	1792.5	1791.5	1791.75	1130	1790.5
NQ05MIR	5	12/11/2009	1415	1791.75	1791.75	1791	1791	521	1789.75
NQ05MIR	5	12/11/2009	1420	1791	1792	1790.75	1791.25	1115	1790
NQ05MIR	5	12/11/2009	1425	1791	1791.5	1790.5	1791	933	1789.75
NQ05MIR	5	12/11/2009	1430	1791	1791.5	1790	1790	1180	1788.75
NQ05MIR	5	12/11/2009	1435	1790	1790	1788.5	1789	849	1787.75
NQ05MIR	5	12/11/2009	1440	1789	1790	1788	1789.25	1923	1788
NQ05MIR	5	12/11/2009	1445	1789.25	1791	1789.25	1789.75	1078	1788.5
NQ05MIR	5	12/11/2009	1450	1789.5	1790.75	1789.5	1789.75	1168	1788.5
NQ05MIR	5	12/11/2009	1455	1789.75	1790.75	1789	1789.25	1639	1788
NQ05MIR	5	12/11/2009	1500	1789	1790	1788.5	1790	1012	1788.75
NQ05MIR	5	12/11/2009	1505	1790	1790.25	1789.5	1789.5	574	1788.25
NQ05MIR	5	12/11/2009	1510	1789.75	1791.25	1789.25	1791	1284	1789.75
NQ05MIR	5	12/11/2009	1515	1791	1791	1789.75	1790	756	1788.75
NQ05MIR	5	12/11/2009	1520	1789.75	1791.25	1789	1790.5	1323	1789.25
NQ05MIR	5	12/11/2009	1525	1790.75	1793.25	1790.75	1793	2501	1791.75
NQ05MIR	5	12/11/2009	1530	1793	1794	1792.25	1793	2677	1791.75

If you are writing to a data .txt file ... and then trying to read that file ... before closing and reopening it ... that also will be a problem.

You can write a short program to validate the data in your .txt files ... each line seems to have 10 regularly occurring fields ... that you can confirm if all exist ok. If data files are all fields ok ... then you have isolated the problem to be with the programs.

Edited 1 Year Ago by David W

that's why I chose small input data files, so I could manually eyeball them. The 5min data file looks fine. The issue must be the program because it outputs the first analysis output file to the directory, but it doesn't output the moving average output file.

Actually on second thought: the above can't be because the program works fine with the 1 min data file, it outputs the moving average txt file just fine.
Wow, runtime errors are fun!

Edited 1 Year Ago by toneranger

'Eyeballing' is not sufficient here ... You need to validate each line and every field in each line, with a short data validation program that matches the data field requirements of your original data processing programs. That fairly short and easy to code program can just read every line till done ... then using perhaps stringstream objects ... or a custom 'split' function ... parse every field in that line to make sure all fields there are expected (and each is correct type and in valid acceptable range) and thus that no extra or corrupted fields are present.

Edited 1 Year Ago by David W

Both of your test files ...

https://www.daniweb.com/attachments/2/d01478039506623f9c6fedd582703af8.txt

https://www.daniweb.com/attachments/2/da9dcdde1e01ed1698cce4689c5ff447.txt

... seem to be valid when (only roughly) tested like this:

// fileReadValidate.cpp //  // 2015-09-01 //

#include <iostream>
#include <fstream>
#include <string>
#include <sstream>

using namespace std;

const char* FILE_IN  = "five09_15.79 KB.txt"; // "csv_file_78.11_KB.txt"; // // "five09_15.79 KB.txt"; //

template< typename T >
bool isValid( const string& str )
{
    T tmp;
    istringstream iss( str );
    if( iss >> tmp ) return true;
    return false;
}

bool isValidIntRange( const string& str, int min, int max )
{
    istringstream iss( str );
    int tmp;
    iss >> tmp;
    if( tmp < min || tmp > max )
    {
        cout << "Date field value " << tmp << " not in range " << min << ".." << max << '\n';
        return false;
    }
    return true;
}

bool isValidDate( const string& str )
{
    if( str.size() == 10 )
    {
        if( str[2] == str[5] && str[2] == '/' )
        {
            if( !isValid< int >( str.substr(0,2) )
                || !isValid< int >( str.substr(3,2) )
                || !isValid< int >( str.substr(6,4) ) )
            {
                cout << "Invalid date field ... non integer day or month or year ...\n";
                return false;
            }
            else
            {
                if( !isValidIntRange( str.substr(0,2), 1, 12 ) )
                {
                    cout << "Invalid month field\n";
                    return false;
                }
                if( !isValidIntRange( str.substr(3,2), 1, 31 ) )
                {
                    cout << "Invalid day field\n";
                    return false;
                }
                if( !isValidIntRange( str.substr(6,4), 1900, 3000 ) )
                {
                    cout << "Invalid year field\n";
                    return false;
                }

                return true;
            }
        }
        else
        {
            cout << "Invalid date field ... missing '/' ...\n";
            return false;
        }
    }
    else
    {
        cout << "Invalid date size of " << str.size() << endl;
        return false;
    }
}


bool isValidLine( const string& line )
{
    istringstream iss( line );;
    int count = 0;
    string tmp;
    while( iss >> tmp )
    {
        ++count;
        if( count == 2 || count == 4 || count == 9 )
        {
            if( !isValid< int >( tmp ) )
            {
                cout << "Invalid field at " << count << endl;
                return false;
            }
        }

        else if( (count >= 5 && count <= 8) || count == 10 )
        {
            if( !isValid< double >( tmp ) )
            {
                cout << "Invalid field at " << count << endl;
                return false;
            }
        }

        else if( count == 3 )
        {
            if( !isValidDate( tmp ) )
            {
                cout << "Invalid field at " << count << endl;
                return false;
            }
        }
        else // count == 1 //
        {
            if( tmp != "NQ01MIR" && tmp != "NQ05MIR" )
            {
                cout << "Invalid field at " << count << endl;
                return false;
            }
        }
    }

    if( count != 10 )
    {
        cout << "Invalid field count of " << count << endl;
        return false;
    }

    return true;
}




int main()
{
    ifstream fin( FILE_IN );
    if( fin )
    {
        string line;
        int count = 0;
        while( getline( fin, line ) )
        {
            ++count;
            if( !isValidLine( line ) )
            {
                cout << "Line " << count << " was NOT valid\n";
                break;
            }
        }

        fin.close();
        cout << "Done now." << endl;
    }
    else
        cout << "There was a problem opening file " << FILE_IN  << endl;
}

So the problem, then, seems to be with your program.

Edited 1 Year Ago by David W

Late edit to above: better to substitute above function with this function ...

template< typename T >
bool isValid( const string& str )
{
    T tmp;
    istringstream iss( str );
    if( iss >> tmp
    && iss.eof() ) // The 2nd test ensures entire string converted. //
    {
        return true;
    }
    // else ...
    cout << "Field value " << str << " not valid\n";
    return false;
}

Edited 1 Year Ago by David W

This article has been dead for over six months. Start a new discussion instead.