Need help to use regex to do search and replace. Don't know how to and can't figure out how :(
Hi,
Below is an excerpt from a 20000+ lines and I want to do a search and replace of a specific string but I don't know how and I can't figure out how to. Can't find an example from Google or anywhere to do what I am wanting to do.
Code:
A 2018-11-21 08:42:17 TEST_TEST 2018-11-21 00:50:45 Accessed: 2,146,893,824 /NFS_mnt/mnlNFS111/vol_abcp_db/abcp/.snapshot/mnl1ns123_vol_abcp_db_ss.0/db/temp/abcp_temp_10.dbf
A 2018-11-21 08:41:52 TEST_TEST 2018-11-21 00:50:45 Accessed: 2,146,697,216 /NFS_mnt/mnlNFS111/vol_abcp_db/abcp/.snapshot/mnl1ns123_vol_abcp_db_ss.0/db/temp/abcp_temp_9.dbf
A 2018-11-21 03:29:04 TEST_TEST 2017-06-17 22:01:33 Accessed: 22,528 /NFS_mnt/mnlNFS111/vol_abcp_db/abcp/.snapshot/mnl1ns123_vol_abcp_db_ss.0/db/LTS/abcp_ABCD_TEST_COMM_P201406_tts_exp.dta
A 2018-11-21 03:28:57 TEST_TEST 2017-06-17 22:01:28 Accessed: 563,101,696 /NFS_mnt/mnlNFS111/vol_abcp_db/abcp/.snapshot/mnl1ns123_vol_abcp_db_ss.0/db/LTS/abcp_abcd_test_comm_201406_data_01.dbf
I need to search for all lines that contain the string /db/LTS/abcp_ but only those that ends in .dbf. So from the excerpts above, it should find the line below:
Code:
A 2018-11-21 03:28:57 TEST_TEST 2017-06-17 22:01:28 Accessed: 563,101,696 /NFS_mnt/mnlNFS111/vol_abcp_db/abcp/.snapshot/mnl1ns123_vol_abcp_db_ss.0/db/LTS/abcp_abcd_test_comm_201406_data_01.dbf
And I want to replace them so it so that it will be
Code:
A 2018-11-21 03:28:57 TEST_TEST 2017-06-17 22:01:28 Accessed: 563,101,696 /NFS_mnt/mnlNFS111/vol_abcp_db/abcp/.snapshot/mnl1ns123_vol_abcp_db_ss.0/db/LTS/abct_abcd_test_comm_201406_data_01.dbf
So, basically I need to change /db/LTS/abcp_ to /db/LTS/abct_. It is the one in BOLD that I am wanting to search and replace.
The grep regex below seems to do what I wanted. But I don't know how to do like a sed search and replace thing
P.S.:
- Is there any way to colorize or highlight certain text? I was hoping to be able to do that in this post but can't find the option to do so. I thought that option was available on the older forum ???
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Hi guys, I asked for help on programming forums and no one didn't helped me so I ask for help here. I am playing with some tasks from my book and I can't figure where did I get wrong.
From the first program I get a blank screen, program won't generate 10*10 matrix.
And second problem is I... (6 Replies)
Hi,
I need to run a search and replace on a large database,
what I need to change is all instances of
#### (eg. 1764 or 1964)
to
(####) (eg. (1764) or (1964))
But there might be other numbers in there such as
(1764) and I do not need those changed to ((1764))
How can I... (7 Replies)
Hi,
I'm trying to match the front and back of a sequence. It works when there is an exact match (obviously), but I need the regex to be more flexible. When we get strings of nucleotides sometimes their prefixes and suffixes aren't exact matches. Sometimes there will be an extra letter and... (2 Replies)
I have file which contains data in the following format all in a single line:
BDW_PUBLN_ID DECIMAL(18:0) NOT NULL PRIMARY INDEX ARGO_ACCT_DEP_PI ( OFC_ID ,CSHBX_ID ,TRXN_SEQ_NUM ,PROCG_DT ) PARTITION BY RANGE_N(PROCG_DT BETWEEN DATE '2012-03-01' AND DATE '2014-12-31' EACH INTERVAL '1' MONTH );... (4 Replies)
Basically what the title says. Had to replace the motherboard on an HP DL380 G6 today, of course now the embedded NICs don't work because the ifcfg-eth files have the MAC addresses for the embedded NICs from the old machine.
How can I find the new/correct MAC addresses so I can edit the... (2 Replies)
Have Pipe Delimited File:
> BRYAN BAKER|4/4/2015|518 VIRGINIA AVE|TEST
> JOE BAXTER|3/30/2015|2233 MockingBird RD|ROW2On 3rd column where the address is located, I want to add a space after every numeric value - basically doing a "s//&\ / ":
> BRYAN BAKER|4/4/2015|5 1 8 VIRGINIA AVE|TEST
> JOE... (5 Replies)
Discussion started by: svn
5 Replies
LEARN ABOUT DEBIAN
ltsinfo
LTSINFO(1) User Commands LTSINFO(1)NAME
ltsinfo - display basic information about an LTS
SYNOPSIS
ltsinfo [OPTION]... [INFILE]
DESCRIPTION
Print information about the labelled transition system (LTS) in INFILE. If INFILE is not supplied, stdin is used.
The format of INFILE is determined by its contents. The option --in can be used to force the format for INFILE. The supported formats are:
'aut' for the Aldebaran format (CADP),
'dot' for the GraphViz format,
'fsm' for the Finite State Machine format,
'lts' for the mCRL2 LTS format, or
'svc' for the SVC format
OPTIONS
OPTION can be any of the following:
-iFORMAT, --in=FORMAT
use FORMAT as the input format
--timings[=FILE]
append timing measurements to FILE. Measurements are written to standard error if no FILE is provided
Standard options:
-q, --quiet
do not display warning messages
-v, --verbose
display short intermediate messages
-d, --debug
display detailed intermediate messages
--log-level=LEVEL
display intermediate messages up to and including level
-h, --help
display help information
--version
display version information
AUTHOR
Written by Muck van Weerdenburg.
REPORTING BUGS
Report bugs at <http://www.mcrl2.org/issuetracker>.
COPYRIGHT
Copyright (C) 2012 Technische Universiteit Eindhoven.
This is free software. You may redistribute copies of it under the terms of the Boost Software License
<http://www.boost.org/LICENSE_1_0.txt>. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
See also the manual at <http://www.mcrl2.org/mcrl2/wiki/index.php/User_manual/ltsinfo>.
ltsinfo mCRL2 toolset 201202.0 (Release) April 2012 LTSINFO(1)