Command Prompt Script to Append Flat Files

 

 Command Prompt Script to Append Flat Files



There was a requirement to merge \ append multiple flat files within one folder and in addition - it should also be able to read header file from 1st file but then remove header row from other subsequent flat files 


Below Command Prompt script  will be able to resolve this issue:



@echo off

set "skip="

>summary.txt (

  for %%F in (*.csv) do if defined skip (

    more +1 "%%F"

  ) else (

    more "%%F"

    set skip=1

  )

)


Comments

Popular posts from this blog

Calculating Age of the person in T-SQL

How to Troubleshoot Subscription issue in Reporting Services

MDX Queries - Current Day - Month and Year