I have a txt file containing multiple rows of identical size:
(Examples)
0123456 789 AND abcdefg hij
For all rows in the file I want to add a space after the 4th character shifting the following characters to the right by 1 character. I also want to remove the space from the 8th character (which would be 9th after the initial space is added).
I have cygwin installed so sed is an option.
I also have php and visual studio 2010 installed.
Any help on this would be greatly appreciated.
I ended up just using Cygwin -> VIM.
Open input file in Vim Editor.
Go to first line, first character using “:1”
Start recording using “qa” (Where a is the name of your macro)
Move to the 4th character of line.
Enter into edit mode by pressing “insert” or “i”
Type your space character.
Press Esc.
Move to first character by pressing “Shift+^”.
Move to next line’s first character.
Press q to quit from recording mode.
Now play whatever you have recorded for any number of times you want.
If you want to play it once press @a
If you want to repeat this 10 times then type 10@a
(where a is the macro name you defined earlier)
Deleting a space follows the same steps except you don’t need to go into edit mode just go to the space you want to remove and hit x and move on with the instructions.