C# Tabdelimited text File with multiple column to datatable [on hold]

Multi tool use
Multi tool use











up vote
1
down vote

favorite












I am trying to convert my text file having TabDelimited data to Datatable, Text file data shown below:



Row1Col1 Row1Col2 Row1Col3 Row1Col4_0

                                                      Row1Col4_1

                                                      Row1Col4_2



Row2Col1 Row2Col2 Row2Col3 Row2Col4

                  Row2Col2



Used Below code for conversion:


using (OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + file.DirectoryName + ";Extended Properties='text;CharacterSet=" + characterSet + ";HDR=No;FMT=TabDelimited';"))

{

    using (OleDbCommand cmd = new OleDbCommand(string.Format("SELECT * FROM [{0}]", file.Name), con))

{

        con.Open();

    using (OleDbDataAdapter adp = new OleDbDataAdapter(cmd))

{

             DataTable tbl = new DataTable("MyTable");

                 adp.Fill(tbl);

}

}

}



It's showing me multi line value of column into different column.










share|improve this question







New contributor




Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Mokubai 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Programming questions are off topic here and should be asked on Stack Overflow. You should show how exactly the code is not working for you.
    – Mokubai
    2 days ago















up vote
1
down vote

favorite












I am trying to convert my text file having TabDelimited data to Datatable, Text file data shown below:



Row1Col1 Row1Col2 Row1Col3 Row1Col4_0

                                                      Row1Col4_1

                                                      Row1Col4_2



Row2Col1 Row2Col2 Row2Col3 Row2Col4

                  Row2Col2



Used Below code for conversion:


using (OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + file.DirectoryName + ";Extended Properties='text;CharacterSet=" + characterSet + ";HDR=No;FMT=TabDelimited';"))

{

    using (OleDbCommand cmd = new OleDbCommand(string.Format("SELECT * FROM [{0}]", file.Name), con))

{

        con.Open();

    using (OleDbDataAdapter adp = new OleDbDataAdapter(cmd))

{

             DataTable tbl = new DataTable("MyTable");

                 adp.Fill(tbl);

}

}

}



It's showing me multi line value of column into different column.










share|improve this question







New contributor




Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Mokubai 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Programming questions are off topic here and should be asked on Stack Overflow. You should show how exactly the code is not working for you.
    – Mokubai
    2 days ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am trying to convert my text file having TabDelimited data to Datatable, Text file data shown below:



Row1Col1 Row1Col2 Row1Col3 Row1Col4_0

                                                      Row1Col4_1

                                                      Row1Col4_2



Row2Col1 Row2Col2 Row2Col3 Row2Col4

                  Row2Col2



Used Below code for conversion:


using (OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + file.DirectoryName + ";Extended Properties='text;CharacterSet=" + characterSet + ";HDR=No;FMT=TabDelimited';"))

{

    using (OleDbCommand cmd = new OleDbCommand(string.Format("SELECT * FROM [{0}]", file.Name), con))

{

        con.Open();

    using (OleDbDataAdapter adp = new OleDbDataAdapter(cmd))

{

             DataTable tbl = new DataTable("MyTable");

                 adp.Fill(tbl);

}

}

}



It's showing me multi line value of column into different column.










share|improve this question







New contributor




Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am trying to convert my text file having TabDelimited data to Datatable, Text file data shown below:



Row1Col1 Row1Col2 Row1Col3 Row1Col4_0

                                                      Row1Col4_1

                                                      Row1Col4_2



Row2Col1 Row2Col2 Row2Col3 Row2Col4

                  Row2Col2



Used Below code for conversion:


using (OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + file.DirectoryName + ";Extended Properties='text;CharacterSet=" + characterSet + ";HDR=No;FMT=TabDelimited';"))

{

    using (OleDbCommand cmd = new OleDbCommand(string.Format("SELECT * FROM [{0}]", file.Name), con))

{

        con.Open();

    using (OleDbDataAdapter adp = new OleDbDataAdapter(cmd))

{

             DataTable tbl = new DataTable("MyTable");

                 adp.Fill(tbl);

}

}

}



It's showing me multi line value of column into different column.







c# asp.net textfiles asp






share|improve this question







New contributor




Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









Pratik

62




62




New contributor




Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Pratik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by Mokubai 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by Mokubai 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.












  • Programming questions are off topic here and should be asked on Stack Overflow. You should show how exactly the code is not working for you.
    – Mokubai
    2 days ago


















  • Programming questions are off topic here and should be asked on Stack Overflow. You should show how exactly the code is not working for you.
    – Mokubai
    2 days ago
















Programming questions are off topic here and should be asked on Stack Overflow. You should show how exactly the code is not working for you.
– Mokubai
2 days ago




Programming questions are off topic here and should be asked on Stack Overflow. You should show how exactly the code is not working for you.
– Mokubai
2 days ago















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

dWmnGPX45QD,1a4UmX2q,bwf,8PmnSVb sWQ Jtgrw,lf3,I4Ru3GrdDnH jcZ,BpVR0n,G,tys CvE4U
0Gp7s sRbN jHp3OglZk0

Popular posts from this blog

What is the story behind “peach kanji” 桃?

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations