![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Posts: 2
Rep Power: 0
![]() |
updating a text file
Hello
I'm a bit of a newbie so bare with me. I'd like to edit a number in a text doucment. The document looks like this: row1: 20 row2: 40 row3: 49 I basically just want to be able to change these numbers. So far I've been able to get these numbers into a c-program by calling a shell script that uses grep and gawk. Now based on the results of my c-program I'd like to call another script that modifys the numbers in the txt document. I think I might need to use the grep and gawk again along with sed but am not really sure. Can someone please tell me how to go about doing this. Thanks OJ |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 314
Rep Power: 4
![]() |
I'd use sed. See the sed manpage; if you don't have it local, try here: http://www.tu-berlin.de/zrz/dienste/...pages/sed.html
|
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4
![]() |
If you tell us how you want modify the numbers - show the starting value and the ending value, then we can help. awk or gawk will do an awful lot for you.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|