속은 느낌

해외취업에 관심이 있어 등록한 몬스터닷컴에서 뉴스레터가 왔다. 뉴스레터중 Acronym IQ테스트가 있는데,

What's Your Tech Acronym IQ? 

Think you know your PGP from your PHP? InsideTech's ultimate tech acronym quiz will put you to the test. Give it a shot and find your tech acronym IQ.

재미있을 듯해서 45문제를 모두 풀었다. 나름 A학점 이상을 기대했는데,아 이넘들 회원가입을 유도하는 구만.

by 타임버드 | 2009/11/06 07:51 | 트랙백 | 덧글(0)

Reading a CSV file

If you're just trying to read a CSV file with C#, the easiest thing is to use the Microsoft.VisualBasic.FileIO.TextFieldParser class. It's actually built into the .NET Framework, instead of being a third-party extension.

Yes, it is in Microsoft.VisualBasic.dll, but that doesn't mean you can't use it from C# (or any other CLR language).

Here's an example of usage, taken from the MSDN documentation:

Using MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser("C:\testfile.txt")
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(",")
Dim currentRow As String()
While Not MyReader.EndOfData
Try
currentRow = MyReader.ReadFields()
Dim currentField As String
For Each currentField In currentRow
MsgBox(currentField)
Next
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
MsgBox("Line " & ex.Message & _
"is not valid and will be skipped.")
End Try
End While
End Using

by 타임버드 | 2009/11/05 14:58 | 트랙백 | 덧글(0)

◀ 이전 페이지          다음 페이지 ▶