Solved

Index was outside the bounds of the array

  • 25 October 2023
  • 6 replies
  • 204 views

Hi team,

I’m facing the following issue when Multiple Text File connector to pull in *.TXT files. I’m getting the following error “Index was outside the bounds of the array” when i execute table in the ODX.

 

 

 

 

icon

Best answer by Thomas Lind 26 October 2023, 09:54

View original

6 replies

Userlevel 5
Badge +7

Hi @amartinez ,

 

could it be that your text files contain either the field delimiter or row delimiter inside a field somewhere? Does it fail for all files or only one or a few?

 

Userlevel 6
Badge +5

Hi @amartinez 

You will get this for any field that is longer than what you set as the data type, it will not tell you what field this is, so there are a few ways to figure out what to do.

You set all fields to nvarchar(4000) and synchronize and see if it goes through.

If it is a delimiter issue as suggested by Rory, it may not be enough as it has a max character limit of 4000 in one field, so then your only option is to manually look at the file to see if you can locate the issue or create a CData CSV data source and point to the same file with that. If you have set the row scan depth to 0 it will read the whole file before determining the data types and it should be easier to see what fields gives issues.

Userlevel 6
Badge +5

@amartinez can you please send some dummy files with non-sensitive data?

Thanks for the suggestions. Tab delimited text file is a bit tricky and will run into all sorts of issues due to length and amount of characters. I'm still working working on getting this to work, but will share with the community once I figure it out.

@amartinez can you please send some dummy files with non-sensitive data?

Sure thing. Let me scramble some of the data and I will send it over to you. 

Userlevel 6
Badge +5

@amartinez have you had a chance to scramble the files? 

Reply