I have to parse a file so that I can import it to excel. So, I thought the best way was to create a csv file. In this file, I have to divide contents into different categories and represent them in different columns. So, I have parsed the file to create different arrays corresponding to the categories. Now, I am trying to create a csv file with these arrays (thought of using a for loop). But the problem is, that arrays are of unequal length.
INPUT
NM_144736.3
NM_144963.1
XM_144975.2
BC144986.1
NM_144989.1
BC145001.1
XM_145018.2
NM_145015.2
XM_030711.2
AK145024.1
AK145030.1
NM_145034.1
I have used regex to parse data into different arrays. All the NM to @array1, XM to @array2, BC to @array3, AK to @array4. If creating arrays is not a good idea, please let me know what is? How else can I go about generating csv file from the above data.
Edit:
OUTPUT
NM_144963.1,XM_144975.2,BC144986.1,AK145024.1
NM_144963.1,XM_145018.2,BC145001.1,AK145030.1
NM_144989.1,XM_030711.2
NM_145015.2
NM_145034.1