how to delete different column in a file?
I am new to Linux. I have the foollowing information in a file and I have to delete the 2nd and third column. Please tell me how can I do it?
ft0.fm2.fail | 3Dh | ok | 29.2 | Predictive Failure Deasserted ft1.fm0.fail | 3Eh | ok | 29.3 | Predictive Failure Deasserted ft1.fm1.fail | 3Fh | ok | 29.4 | Predictive Failure Deasserted ft1.fm2.fail | 40h | ok | 29.5 | Predictive Failure Deasserted ft0.fm0.f0.speed | 41h | ok | 29.0 | 10000 RPM ft0.fm1.f0.speed | 42h | ok | 29.1 | 9000 RPM ft0.fm2.f0.speed | 43h | ok | 29.2 | 10000 RPM ft1.fm0.f0.speed | 44h | ok | 29.3 | 11000 RPM ft1.fm1.f0.speed | 45h | ok | 29.4 | 11000 RPM ft1.fm2.f0.speed | 46h | ok | 29.5 | 10000 RPM ft0.fm0.f1.speed | 47h | ok | 29.0 | 9000 RPM thanks -Tuku- |
First, you posted in the wrong forum. You probably want ot go to a sub-forum called programming. Probably the easiest solution to your problem is to write a small bash script. Just google "bash script tutorial" and you'll get flooded.
|
Odd forum to ask this question, indeed, but here's one
possible solution. Code:
awk -F"|" '{print $1"|"$4"|"$5}' datafile Cheers, Tink |
I've moved your thread. Is there anything we could have done to make it clearer that the forum you originally posted this in was only for feedback about LQ itself? Your answer may help improve LQ.
--jeremy |
All times are GMT -5. The time now is 02:59 PM. |