Storing text data into multiple arrays

I am working on a project and I am completely stuck. I basically need to read in text data from a file that is formatted like so:

4 numbers per line separated by a comma (there is no hard set of how many rows, this program should be able to work on any number of rows)

2, 32, 4, 7
4, 8, 3, 8
33, 11, 56, 65

Basically all I need are the 0 elements and the 3rd(last) elements within this text document and I need to convert them into ints and place them into their own arrays:

so for the 0 elements I would have an array (if using the above text example):
zeroArray[] = 2, 4, 33
thirdArray[] = 7, 8, 65

So if i said zeroArray[1] it would be 4, if i said thirdArray[0] it would say 7 (*This is using the above example data, it needs to be able to work with any number)

I need this data to be converted to ints and in their own arrays so that I can do calcuations to each element later on. I need to be able to call methods (that I will write) that will perform these calculations.

This is the problem I am having with this.

I cannot pull the intArray out of the while loop because it is declared within the while loop and that is its scope. But if I try and declare the intArray out of the while loop, it gives me the error 'use of unassigned local variable 'intArray'. When I declare it within the while loop, and attempt to use intArray outside of the while loop, it gives me the error "the name 'intArray' does not exist in the current context'. So my main problem is that I need to be able to access intArray so that I can use it as a parameter for my methods to perform calculations on it.

My second problem is intArray basically holds all 4 lines of data. If I print intArray[0], it prints out all of the 1st numbers listed, (using the example text from above) it prints:
2
4
33
If i print intArray[3], it prints out all of the 4th integers within the text data like so:
7
8
65
I'm assuming what I need to do is make two more arrays, one to hold the 1st elements of text, and a second to hold the 4th elements of text, because these need to be processed differently.

I have attempted to make arrays to store this data but no matter what I try, it doesn't work.
Instead of zeroArray[0] = 2, when I print it, it gives me the whole list:
2
4
33
If I then print zeroArray[1], expecting 4, it once again prints out the whole list
2
4
33

This is no longer in the code I will attach, I have tried several methods, but I am hoping someone knows of a solution

Unfortunately I can really only use loops and 1D arrays (no OOP or 2D arrays, which makes things easier)

Any help would be greatly appreciated, thank you.

` static void Main(string[] args)
{

//declarations
string inputString = "";
string[] results;
int holder = 0;
//import file for reading
FileStream inFile = new FileStream("input.txt", FileMode.Open, FileAccess.Read);
StreamReader myStream = new StreamReader(inFile);
//reads first line
inputString = myStream.ReadLine();
while (inputString != null)
{
//split the line
results = inputString.Split(',');
int[] intArray = new int[results.Length];
//do whatever processing you need to do to store it
for (int index = 0; index < results.Length; index++)
{
if (int.TryParse(results[index], out holder))
{
intArray[index] = holder;
}//end if
}//end for
//reads next line
inputString = myStream.ReadLine();
}//end while
//This is a test to see if the ints are correctly stored
Console.WriteLine(intArray[0]); //<--error here stating that 'The name intArray' does not exist in the current context'
}//end main`

I was storing the values into the array 'intArray' because I wasn't sure how to create a for loop that would be able to store the different values into two different arrays. I can't really think of a way to do so.

Unfortunartely I cannot use lists or 2D arrays or any sort of OOP, which really makes this difficult for me, for this project I can only use loops and 1D arrays. (even though this wouldn't be the most efficient way to do so)

Can I use two arrays instead of a List? 'intArray' does hold the converted integer values (4 different sections and I only need 2 of them for calculcations). Is there anyway to create two arrays that hold intArray[0] and intArray[3] values so that I can proceed to do calculations with them? Also how can I make it so I can use these two arrays outside the loop? If i create an array outside the loop, it won't let me use it within the loop, and if I create an array inside the loop, it won't let me use it outside of the loop.

Not sure why you think you can't use them inside the loop if they are declared outside. They would still be in scope. The issue you'll have is you don't know how many lines are in the file, so you don't know how many you'll have to store.

Momerath, thank you so much, that fixed my problem! I was able to almost completely finish my program, but I came upon on last error that I have worked on for hours but haven't been able to figure out.

I have mArray right now which has a number of integers ranging from 1-35. What I need to do is create a loop that compares each element to the values 1-35. Then I need to store the results within another array

So for example let's say these are the elements within mArray[] = 1, 3, 25, 17, 30, 22, 3, 1, 20, 1
I need to keep a total of how many of each number there is.
For example, in the text above there are (3) 1s, (2), 3s, (1) 25, and so on and so for.
I need to store these results within a new array that can be hard coded to hold 35 elements since that is the range.
mTotalArray[0] could hold the number of 1s so
mTotalArray[0] = 3
mTotalArray[2] can hold all the 3s so
mTotalArray[2] = 2

I have tried numerous methods (foreach, for, while) loops but I always receive the same error, that the index is out of bounds.

Here are is one of the codes that I have attempted to implement but have just given me the index out of bounds error:

mArray is the one that we initalized based on the text data, and mTotalArray has been initialized like so (because the count needs to start at 0 and only increase if a match is found):

I have also tried moving the int vars index and count within the foreach loop but that just resets the counter and nothing is stored.

I have tried others as well, (while, for, if) but no success. Once again I cannot use anything but loops and 1D arrays :(. This is a starting programming class so other topics haven't been presented to us so we have to use the things that we have actually been taught.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...