I have a csv file with following content:
G11123,IT,AMIT,INDIA
G11124,IT,HEMANT,INDIA
.......
.......
I am having around 7000 rows.
I need the another csv file with content:
G11,AMIT,INDIA
G11,HEMANT,INDIA
.........
.......
When I am trying the below command
awk 'BEGIN{FS=OFS=","} {print substr($1,1,3),$3,$4}' file.csv > temp.csv
When I am checking the temp.csv, First row I am not getting as per expectation while In all other rows proper substring is visible:
,AMIT,INDIA
G11,HEMANT,INDIA
...............
...............
Is there something wrong with the above command ?
Regards,