Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Do...? 2

Status
Not open for further replies.

SQLBaby

IS-IT--Management
Jan 3, 2003
158
US
i submit this question in VB(MS Databse) forum too.

I have data in txt file (al most 300 +/- rows)like this

Acct:001000,IMP,180 A: $23656.00 D: $56458.00
Acct:001100,EXP,403 B: $59555.00 E: $165879.00 G: $45565.00

I need to put these information in file like

001000,IMP,180,23656.00,,,56458,,,
001100,EXP,403,,59555.00,,,165879.00

Actualy every row have random information like first row only has 'A' and 'D' information while 2nd. roe has B,E and G. So if from A to E some thing missing it just put comma and space.

Also in every row there are random spaces between B: and $??? like B: 54300.00, i want to remove this space too. Could any body help me how to do that please ...?

Thanks in Advance.


Knowledge is a key of success.



 
You can make the sql code a stored procedure and call it from the VB app. Pass in the name of the file to import as a parameter.

You could do all the parsing in VB and call an SP to do the import - but you can'd get away from executing some sql.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
tes i am thinking the same waym i sent you email, could you reply on my email. Thanks

Knowledge is a key of success.



 
Some decimal values are not inserting in table a crroectly

its like if OVERTIME: 4567.72
it inserting in table a as 4567.70 only

what could be wrong in query...?

Knowledge is a key of success.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top