Computing.Net > Forums > Programming > Select text within batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Select text within batch file

Reply to Message Icon

Name: peterpan
Date: February 18, 2009 at 08:12:54 Pacific
OS: Windows 2000 SP4
Subcategory: Batch
Comment:

Hi,

I have a text file that has hundreds of lines of text. I need to create a batch file that reads all the lines in the text and then switches the 2 lines around.

So i have Text A and Text B in this file called peters.txt that has many lines of text. I want to put Text B in place of Text A and Text A in place of Text B.

The example text i want it to search for are the lines below:

0PW222222PeterPiper PIP Peterpan, Panland

0PW222222PeterPaner PAN Peterpan, Panland

Once it has found the text in the file i want it to switch it in the same file like below so the second line is where the first line was and vice versa:

0PW222222PeterPaner PAN Peterpan, Panland

0PW222222PeterPiper PIP Peterpan, Panland

Can you help please?



Sponsored Link
Ads by Google

Response Number 1
Name: peterpan
Date: February 19, 2009 at 05:40:49 Pacific
Reply:

Hi, i need this urgently, can anyone help


0
Reply to Message Icon

Related Posts

See More


JSP alert Marco button, Copy and pa...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Select text within batch file

Find and Replace text in Batch File www.computing.net/answers/programming/find-and-replace-text-in-batch-file/12413.html

Replace text with batch file www.computing.net/answers/programming/replace-text-with-batch-file/17580.html

Replace text through batch file www.computing.net/answers/programming/replace-text-through-batch-file/20140.html