How to read a text (txt) file, modify and save

  • Follow


I am working on creating sample database, EMS Data Generator (a software to create sample data) is too expensive.  I tried BULK SQL to insert data into MS SQL database, I failed.  I think Matlab can help me but I never did something with reading/modifying file before, I really need help (before making this thread,

Problem:
I have a text file with 1,000 rows SAMPLE.TXT:

1. Marry. William. 2000. College Student. 01/02/1989. Marry@kally.com
2. Peter. Hacker. 40000. Sales Manager. 01/02/1975. Peter@sales.com
................... 
And I would like to have

Insert Into [dbo].[Employee]( FirstName, LastName, Salary, JobTitle, DateOfBirth, Email)
values('Marry','William', '2000', 'College Student', '12/02/1989', 'Marry@kally.com')
Insert Into [dbo].[Employee]( FirstName, LastName, Salary, JobTitle, DateOfBirth, Email)
values('Peter','Hacker', '40000', 'Sales Manager', '01/02/1975', 'Peter@sales.com)
.............. 
In the result file (RESULT.TXT)

=============

I am able to read, and save but without modification 
0
Reply Vinh 4/1/2010 1:21:05 AM


0 Replies
423 Views

(page loaded in 0.021 seconds)

Similiar Articles:













7/24/2012 7:20:02 PM


Reply: