如何从批处理文件中由SQLCMD生成的文件中删除标题“虚线下划线"? [英] How do i remove the header Dashed underline from a file generated by SQLCMD in a batch file?

查看:244
本文介绍了如何从批处理文件中由SQLCMD生成的文件中删除标题“虚线下划线"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从批处理文件中的SQLCMD生成的文件中删除标题下划线? 我正在尝试自动化将文件放在目录中以供另一个应用程序处理的过程,并且该过程在标题下的虚线处阻塞 示例:

How do i remove the header underline from a file generated by SQLCMD in a batch file? I am trying to automate a process that puts a file in a directory to be processed by another app and it chokes on the dashed line under the header Example:

1. Header1 Header2 header3 header4
2. ------  ------  ------  ------ 
3. Data1   Data2   Data3   Data4 
4. Data1   Data2   Data3   Data4 
5. Data1   Data2   Data3   Data4 
6. Data1   Data2   Data3   Data4 

我需要删除第2行,因此其他应用程序不会因此阻塞.该应用需要标题,但会死在其下方的虚线上.

I need to remove line 2. so the other app does not choke on it. The app needs the Headers but dies on the dashed line below it.

推荐答案

JerryG发布:

我在另一个有效的网站上找到了答案.我在SQLCMD调用中使用了-h-1来关闭Headers,然后在sql中建立了我的文件的Select之前放置了Print'Header1 Header2 etc'.其中HeaderX是实际的列名,而文件输出中每个标头之间的制表符是制表符分隔的.工作正常,文件已上传谢谢– JerryG

I found an answer on another site that worked. I used an -h-1 in the SQLCMD call to turn off Headers and then in the sql before the Select that built my file i put a Print 'Header1 Header2 etc.' with the HeaderX being the actual Column name and the tab between each header as the file output is Tab delimited. It worked and the file uploaded Thanks – JerryG

这篇关于如何从批处理文件中由SQLCMD生成的文件中删除标题“虚线下划线"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆