Hi All,
I have a file like below:
1016D"ddd","343","1299"
1016D"ddd","3564","1299"
1016D"ddd","3297","1393"
1016D"ddd","32989","1527"
1016D"ddd","346498","1652"
2312D"ddd","3269","1652"
2312D"ddd","328","1652"
2312D"ddd","2224","2100"
3444D"ddd","252","2100"
3444D"ddd","2619","2100"
I need to split this big file (will contain lot of records like above) into multiple files depending upon the first 4 digits. The output files will be like:
filename.1016.dat
1016D"ddd","343","1299"
1016D"ddd","3564","1299"
1016D"ddd","3297","1393"
1016D"ddd","32989","1527"
1016D"ddd","346498","1652"
filename.2312.dat
2312D"ddd","3269","1652"
2312D"ddd","328","1652"
2312D"ddd","2224","2100"
filename.3444.dat
3444D"ddd","252","2100"
3444D"ddd","2619","2100"
I searched for some examples but they all are done using awk.. and as there is no field separator here I cant use awk..
Please help.
Thanks
D