Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing certain lines 1

Status
Not open for further replies.

jliz2803

IS-IT--Management
Mar 21, 2005
45
CA
I am reading a file I was wondering if there was anyway to only write certain lines of the file based on the date at the end of each line here is the top half of the file.

Category: FRED > Categories > Interest Rates
Link: README File Created: 2005-09-21
FRED (Federal Reserve Economic Data)
Economic Research Division
Federal Reserve Bank of St. Louis

Series files in the data directory sorted by series id:

File Title, Units, Frequency, Seasonal Adjustment, Last Updated
AAA.txt Moody's Seasoned Aaa Corporate Bond Yield, %, M, NA, 2005-09-06
BA3M.txt 3-Month Bankers' Acceptance Rate (DISCONTINUED SERIES), %, M, NA, 2000-06-01
BA6M.txt 6-Month Bankers' Acceptance Rate (DISCONTINUED SERIES), %, M, NA, 2000-06-01
BAA.txt Moody's Seasoned Baa Corporate Bond Yield, %, M, NA, 2005-09-06
CD1M.txt 1-Month Certificate of Deposit: Secondary Market Rate, %, M, NA, 2005-09-06
CD3M.txt 3-Month Certificate of Deposit: Secondary Market Rate, %, M, NA, 2005-09-06
CD6M.txt 6-Month Certificate of Deposit: Secondary Market Rate, %, M, NA, 2005-09-06
CDC.txt Rate for Credit Under the Century Date Change Special Liquidity Facility (DISCONTINUED SERIES), %, Not Applicable, NA, 2000-02-02
CP1M.txt 1-Month Commercial Paper Rate (DISCONTINUED SERIES), %, M, NA, 1997-08-01
CP3M.txt 3-Month Commercial Paper Rate (DISCONTINUED SERIES), %, M, NA, 1997-08-01
CP6M.txt 6-Month Commercial Paper Rate (DISCONTINUED SERIES), %, M, NA, 1997-08-01
CPF1M.txt 1-Month AA Financial Commercial Paper Rate, %, M, NA, 2005-09-06
CPF2M.txt 2-Month AA Financial Commercial Paper Rate, %, M, NSA, 2005-09-06
CPF3M.txt 3-Month AA Financial Commercial Paper Rate, %, M, NA, 2005-09-06
CPN1M.txt 1-Month AA Nonfinancial Commercial Paper Rate, %, M, NA, 2005-09-06
CPN2M.txt 2-Month AA Nonfinancial Commercial Paper Rate, %, M, NA, 2005-09-06
CPN3M.txt 3-Month AA Nonfinancial Commercial Paper Rate, %, M, NA, 2005-09-06
DAAA.txt Moody's Seasoned Aaa Corporate Bond Yield, %, D, NA, 2005-09-20
DBAA.txt Moody's Seasoned Baa Corporate Bond Yield, %, D, NA, 2005-09-20
DBKAC.txt 3-Month Bankers Acceptance Rate (DISCONTINUED SERIES), %, D, NA, 2000-07-03
DCD6M.txt 6-Month Certificate of Deposit: Secondary Market Rate, %, D, NA, 2005-09-20
DCD90.txt 3-Month Certificate of Deposit: Secondary Market Rate, %, D, NA, 2005-09-20
DCP30.txt 1-Month Commercial Paper Rate (DISCONTINUED SERIES), %, D, NA, 2002-06-28
DCPN30.txt 1-Month AA Nonfinancial Commercial Paper Rate, %, D, NA, 2005-09-20
DCPN3M.txt 3-Month AA Nonfinancial Commercial Paper Rate, %, D, NA, 2005-09-20
DDISCRT.txt Discount Rate (DISCONTINUED SERIES), %, D, NA, 2003-02-07
DFF.txt Effective Federal Funds Rate, %, D, NA, 2005-09-20
DGS1.txt 1-Year Treasury Constant Maturity Rate, %, D, NA, 2005-09-20
 
assuming you are already reading the file in line by line..

Code:
'InputLine contains the line read in from the text file
Dim Values() as string = InputLine.Split(",")
Dim LineDate as date
if values.length >=5 andalso IsDate(Values(4)) then
  LineDate = cdate(Values(4))
end if

That will get you the date for each line as long as the line maintains that comma delimited layout.

-Rick


VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top