提及从这一行开始,并在opencsv的特定行

时间:2016-01-11 19:38:16

标签: java opencsv

这是在市场结束后将获得的文件格式。从文件格式看,我决定使用opencsv来读取数据。你能否告诉我如何使这项工作正常工作?

原始CSV文件

,05-Jan-2016
The Nifty witnessed an intraday movement of about 67.95 points.The closing index was 0.09 % down as compared to the previous closing index.

, Traded Value (Rs. In Crores), 17657.69
, Traded Quantity (in Lakhs), 14100.76
, Number of Trades, 7865865
, Total Market Capitalisation (Rs. Crores), 9752722.53

,INDEX,PREVIOUS CLOSE,OPEN,HIGH,LOW,CLOSE,GAIN/LOSS
,Nifty 50,      7791.30,      7828.40,      7831.20,      7763.25,      7784.65,-6.65
,Nifty IT,     11029.25,     11082.60,     11084.60,     10945.20,     10997.15,-32.1
,Nifty Next 50,     19956.85,     20031.05,     20085.40,     19925.60,     20068.75,111.9
,Nifty Bank,     16599.15,     16652.05,     16670.20,     16474.85,     16542.50,-56.65
,Nifty Midcap 100,     13429.40,     13488.20,     13553.75,     13415.00,     13546.20,116.8
,Nifty 500,      6630.80,      6659.85,      6664.10,      6614.95,      6639.50,8.7
,Nifty 100,      7957.90,      7994.40,      7997.85,      7933.45,      7959.85,1.95
,Nifty Midcap 50,      3425.25,      3444.90,      3469.80,      3412.10,      3464.25,39
,Nifty Realty,       172.40,       173.40,       176.20,       172.35,       175.55,3.15
,Nifty Infra,      2725.85,      2738.90,      2747.75,      2715.15,      2723.55,-2.3
,Nifty Energy,      8468.60,      8510.50,      8580.00,      8492.95,      8555.00,86.4
,Nifty FMCG,     20087.80,     20087.35,     20141.60,     19994.50,     20047.45,-40.35
,Nifty MNC,      9520.80,      9547.80,      9559.25,      9459.35,      9492.90,-27.9
,Nifty Pharma,     11733.70,     11803.25,     11812.00,     11689.90,     11741.50,7.8
,Nifty PSE,      3110.50,      3127.95,      3142.30,      3106.70,      3133.60,23.1
,Nifty PSU Bank,      2806.65,      2829.45,      2829.45,      2763.25,      2767.65,-39
,Nifty Serv Sector,     10072.75,     10123.05,     10123.05,     10009.95,     10043.05,-29.7
,India VIX,16.8350,16.8350,16.8350,15.5675,16.7025,-0.1325
,Nifty Auto,      8142.85,      8181.90,      8205.85,      8110.60,      8124.35,-18.5
,Nifty Metal,      1804.90,      1818.15,      1874.45,      1808.05,      1862.70,57.8
,Nifty Media,      2572.30,      2589.15,      2610.50,      2581.85,      2593.75,21.45
,Nifty Small 100,      5648.60,      5676.15,      5718.40,      5642.00,      5696.30,47.7
,Nifty 200,      4138.20,      4157.05,      4159.30,      4126.65,      4141.80,3.6
,Nifty Div Opps 50,      1894.90,      1902.90,      1904.20,      1887.85,      1894.30,-.6
,Nifty Commodities,      2415.45,      2429.00,      2451.90,      2416.25,      2443.85,28.4
,Nifty Consumption,      3562.60,      3570.00,      3578.60,      3560.80,      3568.35,5.75
,Nifty Fin Service,      6909.30,      6942.30,      6942.30,      6873.55,      6891.65,-17.65
,Nifty50 Div Point,        95.23,        95.23,        95.23,        95.23,        95.23,0
,Nifty100 Liq 15,      3020.00,      3039.15,      3040.75,      3005.55,      3017.85,-2.15
,Nifty CPSE,      2063.05,      2077.00,      2087.85,      2064.85,      2083.55,20.5
,Nifty GrowSect 15,      5116.05,      5135.50,      5136.10,      5089.55,      5103.25,-12.8
,Nifty50 PR 2x Lev,      2943.55,      2971.05,      2972.20,      2921.85,      2938.00,-5.55
,Nifty50 PR 1x Inv,       503.05,       500.75,       504.95,       500.65,       503.60,.55
,Nifty50 TR 2x Lev,      3441.60,      3473.75,      3475.10,      3416.25,      3435.10,-6.5
,Nifty50 TR 1x Inv,       465.15,       463.05,       466.90,       462.95,       465.65,.5
,Nifty50 Value 20,      3508.70,      3526.10,      3526.10,      3483.05,      3506.30,-2.4

,ADVANCES,1099
,DECLINES,478
,UNCHANGED,49

,Total securities that have hit their price bands today,161

,TOP 25 Securities Today :
,SYMBOL,SERIES,PREV. CLOSE,CLOSE PRICE,%VAR, VALUE(Rs Crs)
,RELINFRA,EQ,       599.95,       613.00,2.18,621.82
,TATASTEEL,EQ,       256.90,       274.30,6.77,405.3
,JETAIRWAYS,EQ,       732.95,       738.80,0.8,385.78
,RELIANCE,EQ,       995.30,      1005.15,0.99,342.81
,SBIN,EQ,       220.70,       217.75,-1.34,330.84
,TCS,EQ,      2369.60,      2348.95,-0.87,315.14
,RELCAPITAL,EQ,       451.70,       461.30,2.13,292.35
,DLF,EQ,       118.40,       118.40,0,283.9
,HDFC,EQ,      1216.70,      1209.40,-0.6,283.65
,INFY,EQ,      1078.90,      1074.05,-0.45,265.6
,TATAMOTORS,EQ,       377.05,       374.45,-0.69,260.42
,AXISBANK,EQ,       438.40,       436.45,-0.44,243.63
,MARUTI,EQ,      4580.65,      4566.95,-0.3,233.07
,INDIGO,EQ,      1262.10,      1252.95,-0.72,225.58
,ICICIBANK,EQ,       255.55,       256.70,0.45,207.92
,LT,EQ,      1255.95,      1256.90,0.08,207.51
,WOCKPHARMA,EQ,      1578.40,      1579.70,0.08,175.02
,AUROPHARMA,EQ,       844.30,       863.50,2.27,165.09
,LUPIN,EQ,      1795.15,      1783.05,-0.67,156.59
,CADILAHC,EQ,       320.80,       313.60,-2.24,153.08
,IGL,EQ,       519.25,       556.45,7.16,152.68
,JSWSTEEL,EQ,      1044.70,      1083.10,3.68,152.46
,YESBANK,EQ,       705.75,       707.70,0.28,146.15
,SUNPHARMA,EQ,       799.10,       800.50,0.18,130.67
,ITC,EQ,       325.10,       324.85,-0.08,126.06

,Top Five Nifty 50 Gainers:
,SYMBOL,SERIES,CLOSE PRICE,PREV.CLOSE,%CHANGE
,TATASTEEL,EQ,       274.30,       256.90,6.77
,VEDL,EQ,        92.40,        88.95,3.88
,GAIL,EQ,       372.25,       359.80,3.46
,HINDALCO,EQ,        82.60,        80.75,2.29
,ASIANPAINT,EQ,       900.65,       880.80,2.25

,Top Five Nifty 50 Losers:
,SYMBOL,SERIES,CLOSE PRICE,PREV.CLOSE,%CHANGE
,BANKBARODA,EQ,       148.10,       151.20,-2.05
,PNB,EQ,       110.60,       112.80,-1.95
,SBIN,EQ,       217.75,       220.70,-1.34
,COALINDIA,EQ,       325.80,       330.20,-1.33
,HINDUNILVR,EQ,       847.95,       859.00,-1.29

,Securities Price Volume Data in Normal market
,SYMBOL,SERIES,CLOSE PRICE,TRADED VALUE ,TRADED QUANTITY
,20MICRONS,EQ,        35.55,                  2653403.85,74075
,3IINFOTECH,EQ,         5.40,                 25633472.05,4808212
,3MINDIA,EQ,     10784.35,                  5855577.55,541
,549,MF,        10.00,                       20.00,2
,8KMILES,EQ,      2399.90,                264312331.00,109959
,A2ZINFRA,EQ,        27.10,                  9392452.80,346510
,AARTIDRUGS,EQ,       590.10,                  5603896.70,9464
,AARTIIND,EQ,       523.60,                 10381235.80,19846
,AARVEEDEN,EQ,        65.60,                   356074.25,5463
,ABAN,EQ,       230.30,                263146228.65,1135780
,ABB,EQ,      1094.55,                 77524234.90,69794
,ABBOTINDIA,EQ,      5878.10,                  6685338.95,1132
,ABCIL,EQ,       228.95,                  7744918.15,33421
,ABGSHIP,EQ,        72.65,                 31874042.30,435361
,ABIRLANUVO,EQ,      2293.80,               1220488373.15,543403
,ACCELYA,EQ,       937.50,                  6480492.00,6921
,ACE,EQ,        47.30,                 11451206.85,243448
,ACROPETAL,EQ,         4.05,                  1158446.85,282119
,ADANIENT,EQ,        88.60,                465660134.95,5341021
,ADANIPOWER,EQ,        34.30,                410584609.30,12091589
,ADANITRANS,EQ,        38.80,                123528731.15,3159929
,ADFFOODS,EQ,        94.85,                 14323503.70,150469
,ADHUNIK,EQ,        16.05,                  7945668.10,502188
,ADI,EQ,       249.95,                  1604853.45,6419
,ADLABS,EQ,       140.30,                 26302087.10,188134
,ADORWELD,EQ,       316.30,                  2249788.95,7141
,ADSL,EQ,        61.60,                 68661767.95,1093223
,ADVANIHOTR,EQ,        57.50,                  1303275.60,22402
,ADVANTA,EQ,       440.95,                149001835.40,340794
,AEGISCHEM,EQ,       109.50,                 23773868.70,219042
,AFL,EQ,        87.10,                  4872374.75,55602
,AGARIND,EQ,       184.30,                  6863591.25,36886
,AGCNET,EQ,        94.55,                  1075412.65,11238
,AGRODUTCH,EQ,         4.05,                    39066.20,9439
,AHLEAST,EQ,       169.35,                   508708.30,3046
,AHLUCONT,EQ,       284.05,                  4896126.85,17187
,AHLWEST,EQ,       130.00,                    39468.00,304
,AIAENG,EQ,       876.10,                 26181205.55,29739
,AICHAMP,BE,        37.00,                     7585.50,205
,AIFL,EQ,       295.00,                 19574219.55,66742
,AIL,EQ,       684.20,                 13358109.75,19486
,AJANTPHARM,EQ,      1309.85,                245053281.75,187695
,AJMERA,EQ,       174.95,                 25020157.45,143913
,AKSHOPTFBR,EQ,        19.15,                 66137059.25,3426971
,AKZOINDIA,EQ,      1366.05,                  5602437.20,4082
,ALANKIT,EQ,        61.15,                 38785375.45,632543
,ALBK,EQ,        67.75,                 82340562.25,1214776
,ALCHEM,EQ,        32.45,                   534756.65,16551
,ALEMBICLTD,EQ,        50.20,                 74942727.30,1526777
,ALICON,EQ,       360.95,                   416857.10,1168
,ALKALI,EQ,        65.10,                   677140.40,10625
,ALKEM,EQ,      1567.70,               1027547097.95,658233
,ALKYLAMINE,EQ,       354.20,                  1317829.40,3752
,ALLCARGO,EQ,       192.95,                 21567537.70,110818
,ALLSEC,EQ,       142.45,                  3551062.75,24831
,ALMONDZ,EQ,        13.45,                   134970.40,9934
,ALOKTEXT,EQ,         6.65,                 87827065.25,13425635
,ALPA,BE,        73.55,                  3356711.30,45191
,ALPHAGEO,EQ,       566.15,                  4626494.70,8197
,ALPSINDUS,EQ,         7.35,                   934228.60,128160
,ALSTOMT&D,EQ,       450.40,                 42144976.15,93419
,AMARAJABAT,EQ,       871.00,                385291323.10,442613
,AMBIKCO,EQ,       905.05,                  5931411.90,6515
,AMDIND,EQ,        36.25,                  9798836.65,269372
,AMRUTANJAN,EQ,       474.30,                  5424740.65,11378
,AMTEKAUTO,EQ,        49.55,                125512013.85,2533654
,AMTL,EQ,        35.00,                   967815.50,27654
,ANANDAMRUB,EQ,        29.00,                   342061.25,11899
,ANANTRAJ,EQ,        45.65,                 73245784.85,1619157
,ANDHRABANK,EQ,        63.55,                 81691827.85,1286527
,ANDHRACEMT,EQ,         9.35,                  6919273.30,739078
,ANDHRSUGAR,EQ,       144.35,                 11128472.15,76472
,ANGIND,EQ,        55.60,                 33281808.45,612807
,ANIKINDS,BE,        31.80,                   429732.15,13534
,ANKITMETAL,EQ,         2.25,                  1244632.85,578581
,ANSALAPI,EQ,        25.50,                 12961009.95,516206
,ANSALHSG,EQ,        28.45,                  1150040.40,40230
,ANTGRAPHIC,BE,          .75,                   177910.85,240272
,APARINDS,EQ,       514.00,                  5055490.10,9829
,APCOTEXIND,EQ,       233.15,                  1070055.05,4600
,APLAPOLLO,EQ,       789.45,                230732086.00,287632
,APLLTD,EQ,       677.85,                 44354712.20,65128
,APOLLOTYRE,EQ,       157.25,                207097370.95,1324704
,APOLSINHOT,BE,       220.50,                   135756.00,615
,APTECHT,EQ,        67.10,                 29169013.70,432520
,ARCHIDPLY,EQ,        61.80,                 10609476.20,174050
,ARCHIES,EQ,        30.10,                 11822565.75,390619
,ARCOTECH,EQ,       344.70,                 31510325.60,90688
,ARIES,EQ,        98.10,                  4468561.55,45669
,ARIHANT,EQ,        54.85,                    13370.90,244
,AROGRANITE,EQ,        64.05,                   617582.85,9705
,ARROWCOAT,EQ,       803.85,                  3174592.90,3947
,ARROWTEX,EQ,        34.60,                  4469146.60,130484
,ARSHIYA,EQ,        51.45,                137675916.35,2805424
,ARSSINFRA,EQ,        55.60,                 49124441.20,869639
,ARVIND,EQ,       361.15,                610245922.80,1718718
,ARVINFRA,EQ,        98.30,                 12366384.55,128030
,ASAHIINDIA,EQ,       164.10,                  3200908.60,19589
,ASAHISONG,EQ,       169.85,                  6295675.20,37613
,ASAL,EQ,        45.30,                   173792.80,3811
,ASHAPURMIN,EQ,        93.15,                 46754703.70,500697
,ASHIANA,EQ,       165.30,                  2594675.60,15684
,ASHIMASYN,EQ,        20.90,                 10943490.25,528463
,ASHOKA,EQ,       189.05,                 46832306.45,246415
,ASIANHOTNR,EQ,       135.60,                   223416.15,1648
,ASIANTILES,EQ,       179.80,                 19285976.40,106176
,ASSAMCO,EQ,         7.70,                 55521658.75,7340501
,ASTEC,EQ,       250.85,                  7647613.95,30335
,ASTRAL,EQ,       422.15,                 10516735.75,24986
,ASTRAMICRO,EQ,       143.45,                133754954.75,938947
,ASTRAZEN,EQ,      1235.50,                 71405920.75,56469
,ATFL,EQ,       554.20,                   843081.65,1542
,ATLANTA,EQ,        39.75,                  3474713.90,88431
,ATLASCYCLE,EQ,       234.70,                 77767191.85,328822
,ATNINTER,EQ,          .25,                      500.00,2000
,ATUL,EQ,      1697.10,                 55121546.45,32094
,ATULAUTO,EQ,       579.20,                 56094407.05,98292
,AURIONPRO,EQ,       206.70,                  3182020.75,15331
,AUSOMENT,EQ,        27.75,                    87688.55,3273
,AUSTRAL,EQ,          .40,                    97111.20,220250
,AUTOAXLES,EQ,       702.30,                   166416.30,237
,AUTOIND,EQ,        55.25,                  3310562.15,59498
,AUTOLITIND,EQ,        70.15,                  3448539.60,48425
,AVANTIFEED,EQ,       424.10,                 12395327.50,29133
,AVTNPL,EQ,        40.10,                 24375276.50,619116
,AXISCADES,EQ,       323.25,                 27574373.20,84659
,AXISGOLD,EQ,      2271.80,                   399230.20,176
,BAFNAPHARM,EQ,        49.80,                 36833319.90,739521
,BAGFILMS,EQ,         4.25,                   654351.25,153965
,BAJAJCORP,EQ,       431.35,                 27985541.15,64640
,BAJAJELEC,EQ,       204.60,                 43906894.30,213803
,BAJAJHIND,EQ,        18.65,                 50024485.75,2662467
,BAJFINANCE,EQ,      5997.85,                307059176.55,51120
,BALAJITELE,EQ,       136.30,                 29455363.30,215109
,BALAMINES,EQ,       159.10,                  2523309.15,16009
,BALKRISIND,EQ,       652.35,                  8310222.05,12683
,BALLARPUR,EQ,        20.85,                 66756010.35,3236506
,BALMLAWRIE,EQ,       625.60,                 18762470.20,30047
,BALPHARMA,EQ,       133.30,                 47552926.85,363304
,BALRAMCHIN,EQ,        73.85,                142185800.25,1922395
,BANARBEADS,EQ,        48.55,                    40971.85,840
,BANARISUG,EQ,      1126.95,                   939871.50,839
,BANCOINDIA,EQ,       145.15,                 12943707.30,88766
,BANG,BE,        21.80,                    24310.75,1150
,BANKBEES,EQ,      1668.14,                  5917790.83,3543
,BANSWRAS,EQ,       127.10,                   782800.95,6268
,BARTRONICS,EQ,        14.10,                  3412857.25,244060
,BASF,EQ,       931.90,                  7496293.45,8013
,BASML,EQ,       251.50,                   308911.35,1232
,BATAINDIA,EQ,       500.80,                121044333.55,240211
,BAYERCROP,EQ,      3363.90,                 20357181.95,6040
,BBL,EQ,       852.20,                 14138057.35,16653
,BBTC,EQ,       492.25,                 23343070.05,47581
,BEARDSELL,BE,       119.00,                   203230.00,1695
,BEDMUTHA,EQ,        17.25,                   165164.95,9528
,BEL,EQ,      1366.15,                363544030.35,264812
,BEML,EQ,      1271.90,                174240990.75,136825
,BEPL,EQ,        24.60,                 11299067.85,456262
,BERGEPAINT,EQ,       257.45,                167010451.80,654241
,BFINVEST,EQ,       146.55,                 10496721.05,70858
,BFUTILITIE,EQ,       688.05,                662553087.35,961519
,BGLOBAL,BE,         5.15,                   421370.85,82412
,BGRENERGY,EQ,       132.85,                 51035963.55,385903
,BHAGYNAGAR,EQ,        22.15,                   767193.65,35217
,BHARATGEAR,EQ,        94.85,                  2836897.30,30318
,BHARATRAS,EQ,      1108.40,                   631476.00,569
,BHARTISHIP,BE,        32.45,                   927406.20,28768
,BHUSANSTL,EQ,        45.35,                 42664087.40,942252
,BIL,EQ,       539.55,                  8823857.85,16344
,BILENERGY,EQ,         1.25,                     1375.00,1100
,BILPOWER,BE,         1.35,                    13500.00,10000
,BINANIIND,EQ,        78.90,                  1833994.95,23254
,BINDALAGRO,EQ,        37.65,                  1536247.40,40945
,BIOCON,EQ,       534.15,                593038234.75,1103610
,BIRLACORPN,EQ,       448.65,                  1192792.20,2652
,BIRLACOT,EQ,          .05,                   268650.20,5373004
,BIRLAERIC,BE,        56.00,                   425278.50,7825
,BIRLAMONEY,EQ,        35.30,                 16242350.60,468196
,BLBLIMITED,EQ,         5.75,                   197252.50,34950
,BLISSGVS,EQ,       180.45,                 79602427.10,440706
,BLKASHYAP,EQ,        23.20,                 16333384.25,715490
,BLUEBLENDS,BE,        47.95,                    12035.45,251
,BLUECHIP,EQ,          .40,                     1921.60,4404
,BLUEDART,EQ,      6720.00,                 18834814.95,2787
,BLUEDART,N1,        10.99,                    20331.50,1850
,BLUESTARCO,EQ,       376.95,                  2486233.15,6564
,BLUESTINFO,EQ,       248.60,                  1871107.80,7553
,BNPCPGII,MF,        10.50,                    55835.00,5080
,BODALCHEM,EQ,        58.80,                 96271359.40,1652722
,BOMDYEING,EQ,        65.45,                104229656.20,1586707
,BPL,EQ,        40.15,                 10429668.00,257259
,BRFL,EQ,       190.05,                  7060298.80,37247
,BRIGADE,EQ,       153.20,                  1719966.45,11208
,BROADCAST,EQ,         3.80,                      226.50,60
,BROOKS,EQ,       109.35,                 69072623.65,654265
,BSELINFRA,EQ,         3.95,                  1544768.55,395829
,BSL,EQ,        95.85,                  5511937.70,59192
,BSLGOLDETF,EQ,      2420.00,                   241838.00,101
,BSLIMITED,EQ,        29.20,                  7113023.05,244438
,BSLNIFTY,EQ,        90.55,                    86965.45,962
,BURNPUR,EQ,        10.50,                  8104707.30,794085
,BUTTERFLY,EQ,       291.40,                 96127950.45,330899
,BVCL,EQ,        19.50,                   184365.40,9682
,BYKE,EQ,       159.35,                 15381998.00,96714
,CADILAHC,EQ,       313.60,               1530776517.60,4874911
,CAMLINFINE,EQ,       105.65,                 51430410.20,482664
,CANDC,EQ,        15.15,                   912027.10,61294
,CANFINHOME,EQ,      1068.65,                 19359551.00,18020
,CANTABIL,EQ,        60.40,                   354643.05,5848
,CAPF,EQ,       426.95,                116917021.45,276000
,CAPLIPOINT,EQ,      1301.70,                 12881245.30,9820
,CARBORUNIV,EQ,       184.80,                  3554390.20,19212
,CAREERP,EQ,       135.60,                  2967745.00,21690
,CARERATING,EQ,      1278.70,                 17915893.45,13915
,CASTEXTECH,EQ,        14.15,                 41900428.90,2950996
,CASTROLIND,EQ,       446.80,                140532490.10,318040
,CCCL,EQ,         6.20,                   469848.90,76579
,CCHHL,EQ,        16.60,                 20832541.55,1294306
,CCL,EQ,       211.80,                 22394862.20,105071
,CEATLTD,EQ,      1061.15,                319894529.60,301981
,CEBBCO,EQ,        26.85,                 17364492.60,655122
,CELEBRITY,EQ,        16.40,                  2994182.55,180786
,CELESTIAL,EQ,        38.65,                 12520667.45,325672
,CENTENKA,EQ,       199.30,                  7601911.30,38084
,CENTEXT,EQ,         3.80,                   554159.40,145963
,CENTRALBK,EQ,        69.45,                 14347366.45,206179
,CENTUM,EQ,       652.25,                 25850662.80,38940
,CENTURYPLY,EQ,       175.05,                 43508019.90,250868
,CENTURYTEX,EQ,       597.40,                678791791.60,1142908
,CERA,EQ,      2005.05,                  4181138.75,2094
,CEREBRAINT,EQ,        22.55,                 29799420.40,1330051
,CESC,EQ,       516.20,                144350942.15,278472
,CGCL,EQ,       203.05,                  3099855.75,15880
,CHAMBLFERT,EQ,        64.05,                 40392229.00,632498
,CHEMFALKAL,EQ,       100.75,                   369684.10,3686
,CHENNPETRO,EQ,       198.55,                 50062110.60,250808
,CHOLAFIN,EQ,       641.90,                213069363.25,327930
,CHROMATIC,EQ,         4.45,                  3892817.50,880075
,CIGNITITEC,EQ,       458.10,                 18109909.70,39492
,CIMMCO,EQ,        87.15,                  1560604.55,17851
,CINELINE,EQ,        26.40,                  2431574.90,94834
,CINEVISTA,EQ,         5.55,                   455065.65,81214
,CLNINDIA,EQ,       779.05,                  4600514.85,5911
,CNOVAPETRO,EQ,        34.30,                    66609.70,1956
,COFFEEDAY,EQ,       282.45,                 49008604.70,173477
,COMPUSOFT,EQ,        12.55,                   453673.35,36745
,CONSOFINVT,EQ,        74.95,                  1489460.30,20020
,CORDSCABLE,EQ,        67.75,                 22800280.45,346342
,COROMANDEL,EQ,       185.85,                 51043853.15,273556
,CORPBANK,EQ,        42.55,                  3444833.90,80891
,COSMOFILMS,EQ,       304.60,                356127682.55,1171592
,COUNCODOS,BE,         8.30,                   376742.55,44474
,COX&KINGS,EQ,       242.60,                 61654916.20,255452
,CPSEETF,EQ,        21.59,                  1773690.03,82492
,CREATIVEYE,EQ,         5.10,                   117468.75,23250
,CREST,EQ,        56.75,                   147384.15,2598
,CRISIL,EQ,      1981.10,                 10172163.80,5174
,CRMFGETF,EQ,      2425.00,                     4850.00,2
,CROMPGREAV,EQ,       198.80,                921444750.45,4654814
,CTE,BE,       154.10,                  2169573.90,14079
,CUB,EQ,        90.90,                 15297453.35,167955
,CUBEXTUB,BE,        15.50,                    32153.00,2026
,CURATECH,EQ,         8.40,                    59550.00,7000
,CYBERMEDIA,EQ,        13.95,                     8105.00,582
,CYBERTECH,EQ,        61.45,                 10840437.00,176584
,CYIENT,EQ,       487.80,                 11653090.90,23648
,DAAWAT,EQ,       261.50,                  3822130.45,14572
,DALMIABHA,EQ,       835.70,                  6417961.75,7691
,DALMIASUG,EQ,        64.20,                  3582051.00,54842
,DATAMATICS,EQ,        71.20,                 14602458.90,203186
,DBCORP,EQ,       326.05,                   622307.25,1902
,DBREALTY,EQ,        58.00,                 11155152.30,191200
,DBSTOCKBRO,EQ,        24.30,                   148880.45,6119
,DCBBANK,EQ,        79.95,                 51677791.20,644570
,DCM,EQ,        97.55,                  8041609.15,82877
,DCMSHRIRAM,EQ,       142.00,                  8991433.05,63756
,DCW,EQ,        29.00,                159552554.40,5596093
,DECCANCE,EQ,       751.10,                  7406651.90,9956
,DEEPAKFERT,EQ,       159.85,                  6622480.15,41452
,DEEPAKNTR,EQ,        74.40,                  2572272.75,34549
,DEEPIND,EQ,       178.45,                 26136054.60,146647
,DELTACORP,EQ,        84.40,                460401276.50,5420514
,DELTAMAGNT,EQ,        31.85,                     2594.25,83
,DEN,EQ,       109.20,                  3386494.60,30876
,DENABANK,EQ,        40.50,                  7627306.95,187704
,DENORA,EQ,       438.40,                 57277027.65,129564
,DHAMPURSUG,EQ,        71.75,                 22303804.65,309680
,DHANBANK,EQ,        22.30,                  5642261.30,252586
,DHANUKA,EQ,       517.10,                  6333222.15,12255
,DHARSUGAR,EQ,        22.45,                    87324.85,3865
,DHFL,EQ,       231.50,                 90444361.35,389698
,DHUNINV,EQ,       151.50,                   118895.90,784
,DIAPOWER,EQ,        43.15,                  4182586.50,96426
,DICIND,EQ,       724.75,                 14511975.70,20148
,DIGJAM,EQ,        17.15,                 61485459.50,3603570
,DISHMAN,EQ,       350.10,                730946555.65,2088496
,DISHTV,EQ,       100.10,                305306937.50,3064022
,DLF,EQ,       118.40,               2839024394.30,23815902
,DLINKINDIA,EQ,       176.15,                  3472310.95,19734
,DOLPHINOFF,EQ,       130.10,                 10060995.35,75566
,DONEAR,EQ,        38.15,                 12620651.05,331733
,DPL,EQ,        84.05,                  1459746.80,17362
,DPSCLTD,EQ,        12.55,                   474083.85,37605
,DQE,EQ,        39.70,                 22841938.50,573296
,DREDGECORP,EQ,       408.05,                 78304107.55,193733
,DSKULKARNI,EQ,       108.90,                 14380875.85,129121
,DSSL,EQ,        15.00,                     4410.00,294
,DTIL,EQ,       319.40,                  3063055.85,9545
,DUNCANSLTD,BE,        16.50,                    15542.50,933
,DWARKESH,EQ,       110.15,                  9706871.30,87676
,DYNAMATECH,EQ,      2380.05,                  2496270.15,1044
,DYNATECH,EQ,        17.15,                   901258.90,52848
,EASTSILK,EQ,         3.65,                   408175.05,112303
,EASUNREYRL,EQ,        52.85,                  5640905.40,107869
,ECEIND,EQ,       152.55,                   908248.40,5969
,ECLERX,EQ,      1391.95,                 11028090.15,7889
,ECLFINANCE,N7,      1283.00,                    11547.00,9
,ECLFINANCE,N2,      1271.00,                   169930.00,134
,ECLFINANCE,N3,      1082.00,                    64882.60,60
,ECLFINANCE,N4,      1325.01,                    13250.10,10
,ECLFINANCE,N5,      1081.00,                  1909683.00,1767
,ECLFINANCE,NB,      1008.20,                   295156.74,292
,ECLFINANCE,N1,      1037.00,                   112827.66,109
,EDELWEISS,EQ,        56.45,                 17014672.25,300647
,EDL,EQ,       100.25,                 10482945.10,104145

1 个答案:

答案 0 :(得分:0)

以下是使用管道流的示例。它可能不是那么漂亮,但它应该以可扩展的方式完成工作:

final String startToken = ",INDEX,PREVIOUS CLOSE,OPEN,HIGH,LOW,CLOSE,GAIN/LOSS";
final String endToken = ",ADVANCES,533";    

final PipedWriter pipedWriter = new PipedWriter();     
PipedReader pipedReaderTmp = null;
try {
    pipedReaderTmp = new PipedReader(pipedWriter);
} catch (IOException e) {
    // do something smart
}
final PipedReader pipedReader = pipedReaderTmp;

// Consumer    
new Thread(new Runnable() {        
    @Override
    public void run() {
        try (CSVReader csvReader = new CSVReader(pipedReader)) {            
            while (true) {                        
                String[] line = csvReader.readNext(); // blocks until the next line is available
                if (line == null) break; // end of stream has been reached
                //
                // Nonsense output routine follows; replace with your own logic
                //
                for (String component : line) {
                    System.out.print(component + '\t');
                }
                System.out.println();
             }            
        } catch (IOException e) {
            // do something smart
        }        
    }
}).start();

// Producer
new Thread(new Runnable() {        
    @Override
    public void run() {
        try (BufferedReader br = new BufferedReader(new FileReader("filename"))) {                        
            String line = null;

            // consume everything up to and including the start token
            while ((line = br.readLine()) != null) {
                if (startToken.equals(line)) break;
            }

            // consume everything up to and including the end token
            while ((line = br.readLine()) != null) {
                if (endToken.equals(line)) break;
                pipedWriter.write(line + '\n');            
            }
            pipedWriter.close();            
        }
        catch (IOException e) {
            // do something smart
        }        
    }
}).start();

此代码创建两个线程。 producer 读取输入文件的相关部分(上面代码片段的下半部分)并将此数据传输到使用者(上层线程),它将其处理为就像它是直接来自磁盘上的文件。