Skip to Content
avatar image
Former Member

How to get the count of columns in Files present at Shared Location

Hello All,

We are extracting the data from files present at shared location into database table.

Some of the files contain 10 fields and some contain 15 fields.

How to check and get the count of columns present in a particular file by writing a BODS script using windows command.

Can anyone please advise me on this?

Regards,

Rajiv

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 18, 2016 at 08:03 AM

    Create a file format with a single large enough varchar field, say varchar(4000).

    Read the first line and count the number of delimiters (if it's a delimited format) or compare the actual length (if it's a fixed format).

    Add comment
    10|10000 characters needed characters exceeded