Quantcast
Channel: Active questions tagged bash+awk - Ask Ubuntu
Viewing all articles
Browse latest Browse all 102

bash to find each time occurrence in text file, then replace with increased (or decreased) time

$
0
0

i need to find each time occurrence in text file,

then replace each occurrencewith increased (or decreased) time.

Example 01

i have the following "file_01.txt"

i need to "add" for example 00:01:02,999

(zero hrs, one min, two sec, 999 millisec)to each time occurrence

file_01.txt

100:59:59,001 --> 00:01:02,350<>Francis<>201:02:35,236 --> 01:03:39,079Where are You ?

this is the result i wish to have.

output_file_01.txt

101:01:02,000 --> 00:02:05,349<>Francis<>201:03:38,235 --> 01:04:42,078Where are You ?

Example 02

i have the following "file_02.txt"

i need to "subtract" for example 00:01:02,200

(zero hrs, one min, two sec, 200 millisec)

file_02.txt

100:59:59,001 --> 00:01:02,350<>Francis<>201:02:35,236 --> 01:03:39,079Where are You ?

this is the result i wish to have.

output_file_02.txt

100:58:56,801 --> 00:01:02,150<>Francis<>201:01:33,036 --> 01:02:36,879Where are You ?

I need to write a bash file for that, butI really have no idea where to start.

Any Help Appreciated.


Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>