|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Hello,
I would like some advice re the following. Suppose I have a file that contains many rows of data. The following line appears approx 1000 times in the file. 1125 0.944 200.00 I would like the line to read (for all 1000 lines) House 1125 0.944 200.00 The only constant value in the line is the 0.944 value. Thanks in advance. |
|
#2
|
||||
|
||||
|
if your file is called values.txt, then you just need to do this at your command line:
perl -pi -e 's/^/House /' values.txt hope that helps christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
|
#3
|
|||
|
|||
|
Quote:
If you have no perl, write sed 's/^/House /' values.txt Regards ![]() |
|
#4
|
|||||
|
|||||
|
christo + zlutovsky
your approach will change Quote:
to Quote:
is that expected ? i read this: Quote:
insert 'home' to all lines containing '0.944' in the 2.nd field. this thread is duplicated, i wrote a sed-cmd in other one ![]()
__________________
working on Solaris[5-9], preferred languages french and C. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > find and replace |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|