Solved

C# text field parser tabs delimited

Posted on 2013-06-11
2
1,313 Views
Last Modified: 2013-06-11
I have a text file that is tab delimited. I have been using this code to read comma delimited files. What is the correct syntax to change this to tab delimited?

// Set up the Delimiters used in the file
tfp.Delimiters = new string[] { "," };
// True if data fields can be in double quotes
tfp.HasFieldsEnclosedInQuotes = true;
// This means that it is a delimited and NOT a fix width file
tfp.TextFieldType = FieldType.Delimited;
// Remove white spaces from begining and ending of each field
tfp.TrimWhiteSpace = true;
0
Comment
Question by:rwheeler23
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39239813
tfp.Delimiters = new string[] { "\t" };

Open in new window

0
 

Author Closing Comment

by:rwheeler23
ID: 39239817
Thank you. I have been hunting for that all day.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question