cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member220897
Participant

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