Create Multiple text File from existing text file (data table) Based on Header and Dynamic value in Header

  • Hi,

    using a data table I am Currently Creating a Single File with BCP command and File is having specific format now ,i want to create multiple files for the same formt

    based on

    00000000000000000000000000000000000000000000000000000000000000000000000000000000 (Header len=80 )

    777777777777777777777777XXXXXXXXXXHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH(len=80)

    HJ00089 XXXXXXXXXXXXX

    HJ09890 XXXXXXXXXXXXX

    888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 (len=80

    11111111111111111111111111111111111111111111111111111111111111111111111111111111 (Footer len=80)

    creating Multiples Files header and footer should be same in all file

    -2nd Line

    at position 25 to 35 contains varible based on which ,i have to create multiple files nd rest position will be same in ll files

    -3rd nd 4th line contins data specific for variable at 2nd line(25-35 position)

    -5th line will also be same in all file

  • Can you define a View that queries what's supposed to be in each file? If so, then you can use that to do one BCP operation per View, and get your files that way.

    If not, then I recommend moving this out of BCP and into SSIS.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply