Inserting spaces using SED/AWK ?
Hi All,
I have a requirement to insert two spaces in a file. The file is of size 350 mb. The file has 182 characters in each line and i need to insert spaces in positions 174 and 175.The rest of the file content should not be altered . After inserting the spaces, there should be 184 characters in each line, including spaces. I am new to unix programming.Please help. Thanks in advance, Aravind |
hello aravindts. please try this command.
# cat FILE | sed -i s/"^.\{173\}"/"& "/ > OUTPUTFILE or to modify directly # sed -i s/"^.\{173\}"/"& "/ FILE |
thnx Konsolebox,
i tried your way it says illegal option -i any other way you know ?? |
perhaps you're using an old version of sed sorry about my first statement. it should be
# cat FILE | sed s/"^.\{173\}"/"& "/ > OUTPUTFILE |
Konsolebox,(I would love to know your real name :-) )
This works. Thank you very much. Regards, Aravind |
All times are GMT -5. The time now is 04:50 PM. |