Find and Replace Text inside file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
karthik
Posts: 1
Joined: 30 Sep 2017 10:34

Find and Replace Text inside file

#1 Post by karthik » 30 Sep 2017 10:42

Hi

A small help needed.

I have few lrc files in a folder .. which can be opened in notepad.
I need to crosscheck whether the following ti ar al la re ve lines existed or not
[ti:xxxxx]
[ar:yyyyy]
[al:zzzz]
[la:EN]
[re:LRCgenerator.com]
[ve:3.00]

And [re:LRCgenerator.com] needs to be replaced with [re:L]

and in each file at the end we will get a line which is not necessary

[04:41.03] ---www.LRCgeenrator.com ---

That total line should be removed

and should save the file as it is.



Can anyone help me on this plz

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Find and Replace Text inside file

#2 Post by dbenham » 30 Sep 2017 11:49

We cannot read your mind. So we don't know how to fully answer your question.

karthik wrote:I need to crosscheck whether the following ti ar al la re ve lines existed or not

What does that really mean? What should happen if the line exists? What should happen if the line does not exist?

How are you comparing strings? Just the prefix, like "[ti:"? or must the entire string exactly match "[ti:xxxxx]"?


Dave Benham

Aacini
Expert
Posts: 1914
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Find and Replace Text inside file

#3 Post by Aacini » 30 Sep 2017 12:19

I invite you to read the first topic in this forum...

Antonio

Post Reply