Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting space in file

Status
Not open for further replies.

cgswong

MIS
Nov 27, 2000
202
0
0
US
Hi all,

I'm trying to insert a single space at column position 53 in all lines for a file but can't quite figure out how to do this. Anybody have any ideas on this please? I'd appreciate any ideas.

Thanks.

Snr Unix System Admin/DBA
Digicel Jamaica (
 
man sed

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Or use awk (untested)

awk '{print substr($0,1,52) " " substr($0,52)}' infile

CaKiwi
 
wongyc2k,

This should work:

sed 's/^\(.\{52\}\)/\1 /' filename

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top