I've got some files like this:
... 1125356700 0 0 0 0 1125356400 15 0 25 0 1125356100 25 0 25 0 1125355800 25 0 25 0 1125355500 25 0 25 0 ... lines here ... 1125397800 0 0 0 0 1125397500 0 0 0 0 1125397200 0 0 0 0 1125396900 0 0 0 0 1125396600 0 0 0 0 1125396300 0 0 0 0 1125396000 39006 0 63597 0 1125395700 63597 0 63597 0 1125395400 63597 0 63597 0 1125395100 63597 0 63597 0 1125394800 63597 0 63597 0 1125394500 63597 0 63597 0 1125394200 63597 0 63597 0 ...
I would like to go through this file, and look at ONLY the four fields on the right, not the timestamp (the first number). If any of those nubmers is over 1000, I would like to replace it with a zero.
Is this possible without a zillion lines of code? Or should I hack up some crazy shell solution?
I imagine that if someone could at least tell me how to break each line into the four separate numbers, ie $var1, $var2, $var3, and $var4, then I could likely get the rest myself, though it wouldn't be pretty.
Thanks a lot,
-Jack C
jack {at} crepinc.com
http://www.crepinc.com/
In reply to String Search/Replace by crep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |