Skip to Content
0

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

Nov 17, 2016 at 04:25 PM

64

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Andrey Surinov
Nov 18, 2016 at 08:03 AM
1

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).

Share
10 |10000 characters needed characters left characters exceeded