Page 1 of 1

inserting spaces into specific locations

Posted: Fri May 17, 2013 8:59 pm
by C0ppert0p
Hi,
I have a file with variable length records.
I want to adjust each record to make them all the same length
I'm trying to figure out is to how to insert spaces at the location infront of the last value on each line
xxxxxxx___yyyyy___zzz.zzz
xxxxxxx___yyyyyyyyyy___zzzz.zzz
xxxxxxx___yyyyyyyy___zzzzz.zzz
xxxxxxx___yyyyyyyyyyyyy___zzzz.zz

xxxxxxx___yyyyy___________zzz.zzz
xxxxxxx___yyyyyyyyyy______zzzz.zzz
xxxxxxx___yyyyyyyy________zzzzz.zzz
xxxxxxx___yyyyyyyyyyyyy___zzzz.zz

( underscores represent spaces )

Thanks in advance:)

Posted: Sat May 18, 2013 1:13 pm
by bbadmin
You could replace all spaces with tabs:

Find what: " +"
Replace with: "\t"
Regular expression: Checked

Then, set appropriate tab stops for each column:

Right click the document, choose Properties and select Tabulation.
Check "Convert existing tabs to spaces when saving".
Set tab stops at columns 11 and 27.
Click OK.


Finally, save the file.