Reputation: 13
I have a file as follows
1RB9A
2B97A
2O9SA
1GWEA
3Q8JA
2YKZA
3O4PA
I would like to get the output as shown below.
1RB9 A
2B97 A
2O9S A
1GWE A
3Q8J A
2YKZ A
3O4P A
How can I do this with awk?
Upvotes: 1
Views: 122
Reputation: 91
You can also use this code:
awk -F, '{$(NF)=" " $(NF);}1' OFS=, file.csv
a,a,a,1,2, 3
g,g,g,j,s, a
1,1,2,2,5, 6
and find out many awk and sed commands in this website. It clearly explains the commands and It's very helpful.
http://www.theunixschool.com/2012/11/awk-examples-insert-remove-update-fields.html
Upvotes: 0
Reputation: 113814
$ awk '{sub(/.$/, " &")} 1' file
3A38 A
2VB1 J
1US0 A
3R6J C
$ sed 's/.$/ &/' file1
3A38 A
2VB1 J
1US0 A
3R6J C
Upvotes: 3