I have a text file with the following contents:
19810101 20
19810102 31
19810103 1
19810701 1
19811105 5
I want something like this and save as a csv file.
1981 01 01 20
1981 01 02 31
1981 01 03 1
1981 07 01 1
1981 11 05 5
Is there an easy way to do this in R, bash or awk?
I was looking at similar posts: [1] Split a string every 5 characters [2]Split into 3 character length but these are all applicable for strings with the same length.