|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#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. "some other data" 1125 0.944 200.00 I would like the line to read (for all 1000 lines) "some other data" House 1125 0.944 200.00 The only constant value in the line is the 0.944 value. Thanks in advance. |
|
#2
|
|||
|
|||
|
Quote:
assumed your exemple, on *nix try sed 's/\(.*\) \([0-9]*[0-9]\) \(0\.944\) \(.*\)/\1 House \2 \3 \4/' inputfile >outputfile NOTA: spaces are relevant \1 is "some other data" \2 are the digits after "some other data" and before 0.944 \3 is 0.944 \4 is all after 0.944 very similar syntax using perl.
__________________
working on Solaris[5-9], preferred languages french and C. Last edited by guggach : March 5th, 2005 at 08:11 AM. Reason: typos |
|
#3
|
|||
|
|||
|
Quote:
great Last edited by caspercoco : March 6th, 2005 at 03:07 PM. Reason: ta |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > find and replace |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|