Click here to Skip to main content
15,923,006 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have text file like following, i want to convert it to to excel.
C#
4|4|Cor|D|CA ABANDONED|147| 167982.71|LKR |167982.71|
4|4|Cor|D|CABANK |CA - BANKS |1|34719.32|LKR | 34719.32|
4|4|Cor|D|CACOLL |COLLECTION ACCOUNTS |56|21253312.77|LKR |21253312.77|
4|4|Cor|D|CACORP|CURRENT CORPORATION |58|381977297.64|LKR |381977297.64|


What I have tried:

i tried line by line appending.but it is time wasting.
Posted
Comments
Richard MacCutchan 17-Feb-16 4:38am    
You cannot write excel files 'line by line'; you need to use the Interop .NET classes.

1 solution

Just use spliter on '|' character and use that array to fill cell in excel simple way as done
@Write Data to Excel using C#
 
Share this answer
 
Comments
Member 12235586 17-Feb-16 2:02am    
yes. i already using | to split the line. but i want to know is there an of method that can append data directly. not the line by line of cell by cell.
sachinskb 17-Feb-16 2:16am    
oklooking that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900