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 |
|
rgp060374
Starting Member
4 Posts |
Posted - 2004-10-22 : 08:51:27
|
| Hi,How can I get rid of the second line of the header when using osql. I want the column names but not the line containing the '----------' characters.My osql looks as follows:osql /U user /P password /d db /S server /i C:\SQL_File.sql /o C:\SQL_File.csv -s , -n -w 2000Thanks. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-10-22 : 13:23:44
|
| Show us SQL_File.sql.Tara |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2004-10-22 : 17:49:56
|
| You can use the "findstr" command-line utility to clean up the output file.Findstr has a switch (/V) to display lines that DO NOT contain the string you're searching for. You can then redirect the output from Findstr into another text file. The following should do the trick:findstr /V "------" C:\SQLFile.csv >C:\SQLFileNoSeparator.csvYou need to start a command prompt and paste the above into the command line. When you run it, it will create a 2nd file called SQLFileNoSeparator.csv that will contain everything but the line containing the "-----" characters. |
 |
|
|
rgp060374
Starting Member
4 Posts |
Posted - 2004-10-25 : 09:53:46
|
| Thanks robvolk |
 |
|
|
|
|
|