Timeline for Bash script Multiply only numbers from a text file?
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 4, 2021 at 17:15 | comment | added | Hebo | Nice answer for numbers formatted as ints (e.g 1500) or floats (e.g. 1.5), but it won't work for scientific notation (e.g. 1.5e3) | |
| Oct 26, 2017 at 12:50 | comment | added | 123 | @abhinandanbr updated answer. | |
| Oct 26, 2017 at 12:50 | history | edited | 123 | CC BY-SA 3.0 | added 8 characters in body |
| Oct 26, 2017 at 12:48 | comment | added | Abhinandan | Thanks. One last thing. What if I have decimal number like 0.0001? For that it fails. | |
| Oct 26, 2017 at 12:45 | comment | added | 123 | @abhinandanbr You used it in your question? There is plenty of documentation. See perldoc.perl.org/perlrequick.html | |
| Oct 26, 2017 at 12:43 | comment | added | Abhinandan | Actually I am not aware of it. | |
| Oct 26, 2017 at 12:42 | vote | accept | Abhinandan | ||
| Oct 26, 2017 at 12:41 | comment | added | 123 | @abhinandanbr do you know how sed replacement works? | |
| Oct 26, 2017 at 12:40 | comment | added | Abhinandan | I would appreciate if you could also explain what the slashes along with alphabets mean. | |
| Oct 26, 2017 at 12:35 | comment | added | 123 | That's it, put that in your loop and remove everything else. Add -i to the flags if you want inplace replacement. | |
| Oct 26, 2017 at 12:33 | comment | added | Abhinandan | Yes. I can use perl although I'm not familiar. Can you write full code with 'for loop', that works for each text file? Also do explain each character. | |
| Oct 26, 2017 at 12:30 | history | answered | 123 | CC BY-SA 3.0 |