Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7661801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:38:48+00:00 2026-05-31T13:38:48+00:00

We recently received a bunch of files with tab-delimiters. We were having difficulties importing

  • 0

We recently received a bunch of files with tab-delimiters.

We were having difficulties importing them in sql server database.

The vendor who sent the files also sent the code below for us to use in converting the files from tab to comma delimiters.

How do I use this file in visual studio.

I have used visual studio several times befor but I have not used it with just single file such as this.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace TabToComma
{
   class Program
   {
      static void Main(string[] args)
      {
         StreamReader sr;
         StreamWriter sw;

         sr = new StreamReader(@"c:\input.txt");
         sw = new StreamWriter(@"c:\output.txt");

         string nextline;
         string replacedline;

         while (sr.Peek() >= 0)
         {
            nextline = sr.ReadLine();
            replacedline = nextline.Replace('\t',','); // replace each tab in line with a comma
            sw.WriteLine(replacedline);
         }
         sr.Close();

         sw.Close();

      }
   }

}

Alternatively, if someone knows how I can accomplish same thing using vbscript please point me in the right direction.

Thanks alot in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:38:49+00:00Added an answer on May 31, 2026 at 1:38 pm

    Also, here’s a replacement for the content of Main() that might make your life easier, as long as the files are of decent size:

    foreach(string f in args) {
        System.IO.File.WriteAllText(f, System.IO.File.ReadAllText(f).Replace('\t', ','));
    }
    

    Compile and drag and drop all your files onto the resulting executable. They’ll be converted automatically.

    You can even grab the compiled executable from here: http://dl.dropbox.com/u/2463964/TabsToCommas.exe if you’re having trouble compiling it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Recently received a DAT file containing a SQL database, i would like to
I recently received a project that contains multiple web applications with no MVC structure.
I recently received a downvote for using the following in a recent answer :
I have recently used an icon file received from our marketing team. The icon
I recently received a PC running Windows 7 for future development as this will
We are under appstore submission process and recently received following review notes from apple
I recently received a Nokia 5000 phone. Now I want to write software for
All -- We recently received a contract to develop a mobile ASP.Net version of
I've recently received a bug report for my software not compiling on a MacOS
I'm running Ubuntu 8.04 and I recently received the following error when visiting a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.