-1

I have some 1000 csv files... which looks something like this...

id,exam1,exam1,exam1,exam2,exam2,exam2,exam3,exam3,exam3....
lv-1,sub1,sub2,sub3,sub1,sub2,sub3,sub1,sub2,sub3....

in the next line Here I have data.... id number and respective marks...

The problem is I want to get separate files list for individual exams along with the id number and also for specific subjects.

How I want example...

id,exam1,exam1
lv-1,sub3,sub2

<----- The Above is for exam1 ----->

id,exam2,exam2
lv-1,sub3,sub2

<----- The Above is for exam2 ----->

Here in the file 2 I want the marks of exam2 with the same stud_id number present in the first column of file 1 with specific subject marks...

Like that I want to do for exam3 and exam4 and so on....

Then later I want all those files to be placed in respective directories of exam1 exam2 exam3 and so on...

Here I dont want to modify the original file... I want to extract and sort the data accordingly.

if any doubts do let me know. I know the problem is big but I believe only coding can solve it in seconds ^_^

Any help would be appreciated alot alot...

Thanks in advance.

Alonso
  • 700
  • 5
  • 19

1 Answers1

1

I wonder if you want us to tell you how to do this or you want us to do this for you? Any language will be good for that purpose. For example if you want to use java, you definitely need to loop through all of the .csv files in your directory, then parse them into a seperate files that you save in a seperate directories.

Things that you probably going to need:

How to iterate over the files of a certain directory, in Java? - here's how to iterate through files in a certain directory

https://docs.oracle.com/javase/7/docs/api/java/lang/String.html - methods that you can use with String class

https://docs.oracle.com/javase/7/docs/api/java/lang/StringBuilder.html - maybe StringBuilder will be useful

How to create a directory in Java? - how to create a directory

Tomek
  • 286
  • 4
  • 11