LoginSignup
0
0

More than 1 year has passed since last update.

SQLCMDで2行目のハイフンを削除するバッチ

Posted at

SQLCMD使用時に2行目に出てくる「---」の行を削除する

削除前:input.txt
削除後:output.txt

下記バッチを作成し、「input.txt」と同じフォルダで実行

@echo off
setlocal ENABLEDELAYEDEXPANSION
set "input_file=input.txt"
set "output_file=output.txt"
set count=0

for /f "usebackq delims==" %%i in (%input_file%) do (
    set /a count=count+1
    echo !count!番目
    if !count! neq 2 echo %%i>>%output_file%
)
pause

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0