Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
steelkilt
Constraint Violating Yak Guru
255 Posts |
Posted - 2002-10-25 : 15:52:53
|
| I have a thorny issue: I need to somehow transform the data from a .OUT file (basically a non-delimited text file that is the only output option of a genetic analysis program) into a usable database table. I'd like to use SQL to do this, some have mentioned PERL, but, again I'd like to stick with SQL Server if at all possible.Such .OUT files are only readable in Word and other word processing programs and the data is very un-database like.Any tips are appreciated.thx |
|
|
VyasKN
SQL Server MVP & SQLTeam MVY
313 Posts |
Posted - 2002-10-25 : 17:52:11
|
| Even if there are no delimiters, you could use DTS import, if the fields in the .OUT file are of fixed width.If the data format is irregular (not in a repeatable pattern, but can be processed line by line, based on code), then you may not be able to take advantage of DTS.From a performance point of view, you are better off processing the file in a low level language like C, and then use the resulting file in DTS.If you want to strictly stick to SQL Server tools, then you could use the ActiveX script task in DTS, to open the file and process it line by line.--HTH,Vyashttp://vyaskn.tripod.com |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-10-26 : 09:48:11
|
| You could also use BULK INSERT or bcp to put the data into a SQL Server table, and use some parsing methods on the raw data. Things like SubString(), PatIndex() and CharIndex() will help you pull data out from unformatted data. You could get better performance than using DTS with ActiveX transforms. |
 |
|
|
|
|
|
|
|