0

SOBA11009_1_1.xml
SOBA11009_1_2.xml
SOBA11009_1_3.xml
SOBA11009_1_4.xml
SOBA11009_1_5.xml
SOBA11009_2_1.xml
SOBA11009_2_1.xml
SOBA11009_2_2.xml
SOBA11009_2_3.xml
SOBA11009_3_1.xml
SOBA11009_3_2.xml
SOBA11009_3_3.xml


978-0-387-98595-4

Is it possible that I want to create a batch file that overwrites the SOBA1109 with
978-0-387-98595-4?

output:

978-0-387-98595-4_1_1.xml
978-0-387-98595-4_1_2.xml
978-0-387-98595-4_1_3.xml
978-0-387-98595-4_1_4.xml
978-0-387-98595-4_1_5.xml
978-0-387-98595-4_2_1.xml
978-0-387-98595-4_2_1.xml
978-0-387-98595-4_2_2.xml
978-0-387-98595-4_2_3.xml
978-0-387-98595-4_3_1.xml
978-0-387-98595-4_3_2.xml
978-0-387-98595-4_3_3.xml

Edited by gian10890: n/a

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by JeoSaurus
0

Hello gian!

There are lots of ways to do what you're looking for. Perhaps the simplest way, when the pattern you need to replace is so consistent, is to use the 'sed' command.

In your script you could replace that part of the filename with something like this:

echo SOBA11009_1_1.xml |sed 's/SOBA11009/978-0-387-98595-4/'

I hope this helps!

0

it didnt work sir. i think its in OS that i'm using. im using windows7

0

I'm sorry for the delay. I'm not sure how one would accomplish this in Windows. there may be something you could do in PowerShell or VB, but I'm not very familiar with either of those.

Somebody else may be able to help, but in the "shell scripting" forum, you're mostly going to find folks with Unix/Linux shell scripting in mind. You might try posting something over in the Visual Basic or Microsoft Windows forums.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.