I have a csv file and like to split the file into smaller files based on column matching in the file using perl. I am working on Linux Rhel6.
fruit1, fruit2,pricerate,quantity orange, apple, 3,9 apple,lemon,8,1 orange, apple,3,8 pineapple,papaya,9,19 orange,apple,3,7 pineapple,papaya,9,10
Output is something like:
fruit1,fruit2,pricerate,quantity orange,apple, 3,9 orange,apple,3,8 orange,apple,3,7
fruit1,fruit2,pricerate,quantity pineapple,papaya,9,19 pineapple,papaya,9,10
the unmatched ones goes into a seperate file. Say file3.