|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with sed
Hi there
I need help building a scrip that change a character in a spesific position in the line what I am looking is replace 10 for 20 that are located in the position 321:322 and the record lenth is 497 can some one help Thanks Puma |
|
#2
|
|||
|
|||
|
sed is line/pattern orientated not line/column orientated.
Suggest you use PERL or AWK instead. |
|
#3
|
|||
|
|||
|
sed can more
Quote:
this is what you are seeking for s/\(.\{5\}\)\(..\)\(.*\)/\1XX\3/g s = substitute \( = start saving data in buffer1 . = any char \{5\} = repeated 5 times \) = end saved buffer1 \(..\) = save next 2 chars in buffer2 \(.*\) = save rest of line in buffer3 \1 = print buffer1 XX = insert XX after buffer1 = replace buffer2 \3 = print buffer3
__________________
working on Solaris[5-9], preferred languages french and C. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Help with sed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|