I have a text file in which the records are in any one of the formats below:

SCI.txt

```
12-12-1990
12-12-1991
CSE Department

```

Or

```
12-12-1990,12-12-1991,CSE Department

```

I want them to be stored in 3 variables

```
a,b,c

```

I am looking for reading a txt file and storing the values into variable using shell script (ksh).

--- Update ---

I have nearly tried all the methods which are available over the internet. I couldnt able to get them worked.

Right now I am trying this method.

```
#!/usr/bin/ksh
#reading the file content and storing in variable
_input="sci.txt"
while IFS='|' read -r fdate rdate dcname
do
   echo "$fdate $rdate $dcname"
done < "$_input"

```

sci.txt content as follows

```
demo1|demo2|demo3

```

But I am not getting any output for the above method.