Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Den
 
Posts: n/a
Default Could I use Vlookup?

I renamed all my digital and scanned photos but I have applications
that refers to the old names and directories.
I want to replace the old names & directories with the new names and
the new directories for all those jpg file .

On sheet 1, I have in col A, all the new directory & filename
and in Col B, all the old file name only (the old directory is not
there)
There are 1500 lines (pictures) that were renamed. (sorted on col B)

Col A Col B
E:\My PICTURES\2004\20040326_1715.jpg hawai.jpg
E:\My PICTURES\2004\20040326_1698.jpg Kat25.jpg
E:\My PICTURES\2004\20040326_1700.jpg LLLL.jpg
E:\My PICTURES\2004\20040508_1697.jpg L05_0592.JPG

On sheet 2, I copied one of the many txt files of an application where
we can find lines
that refers to the old directory and filename of a picture.

lines...
cell[2].images[0].image=../../../E:\My PICTURES\Fam/Friends\kat25_.jpg
lines...
cell[32].images[0].image=../../../E:\My PICTURES\Fam/Friends\Kito6.jpg
lines...
cell[151].images[0].image=../../../E:\MyPICTURES\Others/cats\IMG_0256.JPG
lines...

I want to replace this old directory and filename
E:/My Pictures/Fam/Friends/kat25_.jpg
with the new directory and filename;
E:\My Pictures\2004\20040326_1698.jpg
but also keep the information that preceded the old filename &
directory.

Final result on sheet 2 should be;
cell[2].images[0].image=../../../E:\My Pictures\2004/20040326_1698.jpg

Any suggestions on a possible solution?

Den

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default Could I use Vlookup?

On Sun, 12 Mar 2006 11:50:42 -0500, Den wrote:

I renamed all my digital and scanned photos but I have applications
that refers to the old names and directories.
I want to replace the old names & directories with the new names and
the new directories for all those jpg file .

On sheet 1, I have in col A, all the new directory & filename
and in Col B, all the old file name only (the old directory is not
there)
There are 1500 lines (pictures) that were renamed. (sorted on col B)

Col A Col B
E:\My PICTURES\2004\20040326_1715.jpg hawai.jpg
E:\My PICTURES\2004\20040326_1698.jpg Kat25.jpg
E:\My PICTURES\2004\20040326_1700.jpg LLLL.jpg
E:\My PICTURES\2004\20040508_1697.jpg L05_0592.JPG

On sheet 2, I copied one of the many txt files of an application where
we can find lines
that refers to the old directory and filename of a picture.

lines...
cell[2].images[0].image=../../../E:\My PICTURES\Fam/Friends\kat25_.jpg
lines...
cell[32].images[0].image=../../../E:\My PICTURES\Fam/Friends\Kito6.jpg
lines...
cell[151].images[0].image=../../../E:\MyPICTURES\Others/cats\IMG_0256.JPG
lines...

I want to replace this old directory and filename
E:/My Pictures/Fam/Friends/kat25_.jpg
with the new directory and filename;
E:\My Pictures\2004\20040326_1698.jpg
but also keep the information that preceded the old filename &
directory.

Final result on sheet 2 should be;
cell[2].images[0].image=../../../E:\My Pictures\2004/20040326_1698.jpg

Any suggestions on a possible solution?

Den


First swap your two columns A & B on sheet 1 over so that the new file
name bcomes the subject value of a Vlookup. (You could probably use
offsets in the Formula below but I think that would unnecessarily
complicate it.

Then on Sheet 2, with your old folder/file names in A1:A..., put the
following in B1 and copy down.

=VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

This is an array formula, so enter with CTRL Shift and Enter

I assumed that there was a type above where you said that the second
file name in column B was Kat25.jpg, whereas your old line names
included Kat25_jpg - i.e. with an underscore character.

The '255' number is only there to catch all file names up to 255
characters in length.

HTH
Richard Buttrey
__
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default Could I use Vlookup?

On Sun, 12 Mar 2006 18:01:10 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 11:50:42 -0500, Den wrote:

I renamed all my digital and scanned photos but I have applications
that refers to the old names and directories.
I want to replace the old names & directories with the new names and
the new directories for all those jpg file .

On sheet 1, I have in col A, all the new directory & filename
and in Col B, all the old file name only (the old directory is not
there)
There are 1500 lines (pictures) that were renamed. (sorted on col B)

Col A Col B
E:\My PICTURES\2004\20040326_1715.jpg hawai.jpg
E:\My PICTURES\2004\20040326_1698.jpg Kat25.jpg
E:\My PICTURES\2004\20040326_1700.jpg LLLL.jpg
E:\My PICTURES\2004\20040508_1697.jpg L05_0592.JPG

On sheet 2, I copied one of the many txt files of an application where
we can find lines
that refers to the old directory and filename of a picture.

lines...
cell[2].images[0].image=../../../E:\My PICTURES\Fam/Friends\kat25_.jpg
lines...
cell[32].images[0].image=../../../E:\My PICTURES\Fam/Friends\Kito6.jpg
lines...
cell[151].images[0].image=../../../E:\MyPICTURES\Others/cats\IMG_0256.JPG
lines...

I want to replace this old directory and filename
E:/My Pictures/Fam/Friends/kat25_.jpg
with the new directory and filename;
E:\My Pictures\2004\20040326_1698.jpg
but also keep the information that preceded the old filename &
directory.

Final result on sheet 2 should be;
cell[2].images[0].image=../../../E:\My Pictures\2004/20040326_1698.jpg

Any suggestions on a possible solution?

Den


First swap your two columns A & B on sheet 1 over so that the new file
name bcomes the subject value of a Vlookup. (You could probably use
offsets in the Formula below but I think that would unnecessarily
complicate it.

Then on Sheet 2, with your old folder/file names in A1:A..., put the
following in B1 and copy down.

=VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

This is an array formula, so enter with CTRL Shift and Enter

I assumed that there was a type above where you said that the second
file name in column B was Kat25.jpg, whereas your old line names
included Kat25_jpg - i.e. with an underscore character.

The '255' number is only there to catch all file names up to 255
characters in length.

HTH
Richard Buttrey
__


Sorry, missed off the front bit which concatenates the
cell[2].images...... bit

This assumes there is only one "\" before the reference to the Drive
"E:" reference. If not please post back.

=LEFT(A1,FIND("\",A1)-3)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Den
 
Posts: n/a
Default Could I use Vlookup?

On Sun, 12 Mar 2006 18:11:55 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 18:01:10 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 11:50:42 -0500, Den wrote:

I renamed all my digital and scanned photos but I have applications
that refers to the old names and directories.
I want to replace the old names & directories with the new names and
the new directories for all those jpg file .

On sheet 1, I have in col A, all the new directory & filename
and in Col B, all the old file name only (the old directory is not
there)
There are 1500 lines (pictures) that were renamed. (sorted on col B)

Col A Col B
E:\My PICTURES\2004\20040326_1715.jpg hawai.jpg
E:\My PICTURES\2004\20040326_1698.jpg Kat25.jpg
E:\My PICTURES\2004\20040326_1700.jpg LLLL.jpg
E:\My PICTURES\2004\20040508_1697.jpg L05_0592.JPG

On sheet 2, I copied one of the many txt files of an application where
we can find lines
that refers to the old directory and filename of a picture.

lines...
cell[2].images[0].image=../../../E:\My PICTURES\Fam/Friends\kat25_.jpg
lines...
cell[32].images[0].image=../../../E:\My PICTURES\Fam/Friends\Kito6.jpg
lines...
cell[151].images[0].image=../../../E:\MyPICTURES\Others/cats\IMG_0256.JPG
lines...

I want to replace this old directory and filename
E:/My Pictures/Fam/Friends/kat25_.jpg
with the new directory and filename;
E:\My Pictures\2004\20040326_1698.jpg
but also keep the information that preceded the old filename &
directory.

Final result on sheet 2 should be;
cell[2].images[0].image=../../../E:\My Pictures\2004/20040326_1698.jpg

Any suggestions on a possible solution?

Den


First swap your two columns A & B on sheet 1 over so that the new file
name bcomes the subject value of a Vlookup. (You could probably use
offsets in the Formula below but I think that would unnecessarily
complicate it.

Then on Sheet 2, with your old folder/file names in A1:A..., put the
following in B1 and copy down.

=VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

This is an array formula, so enter with CTRL Shift and Enter

I assumed that there was a type above where you said that the second
file name in column B was Kat25.jpg, whereas your old line names
included Kat25_jpg - i.e. with an underscore character.

The '255' number is only there to catch all file names up to 255
characters in length.

HTH
Richard Buttrey
__


Sorry, missed off the front bit which concatenates the
cell[2].images...... bit

This assumes there is only one "\" before the reference to the Drive
"E:" reference. If not please post back.

=LEFT(A1,FIND("\",A1)-3)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


Hi Richard,


I hope that I understand your question;

The exact strings that comes *before* all the "E:" are

cell[2].images[0].image=../../../
or
cell[32].images[0].image=../../../
or
cell[151].images[0].image=../../../


So there will always be three (3) "/" before the "E:" if I count them
all from the start of the line.

A precision may be needed: on the sheet 2 where we find the txt file
of the application, there are only "/" and *no* "\"

But on the other hand on sheet 1 the new filename (in the computer)
comes with "\"

But this is not a problem since I can change all those "\" that may be
present to "/" after the new filename & directories have been writen
to the txt file.

Den
Canada




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default Could I use Vlookup?

On Sun, 12 Mar 2006 17:16:04 -0500, Den wrote:

On Sun, 12 Mar 2006 18:11:55 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 18:01:10 +0000, Richard Buttrey
wrote:


This assumes there is only one "\" before the reference to the Drive
"E:" reference. If not please post back.

=LEFT(A1,FIND("\",A1)-3)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


Hi Richard,


I hope that I understand your question;

The exact strings that comes *before* all the "E:" are

cell[2].images[0].image=../../../
or
cell[32].images[0].image=../../../
or
cell[151].images[0].image=../../../


So there will always be three (3) "/" before the "E:" if I count them
all from the start of the line.

A precision may be needed: on the sheet 2 where we find the txt file
of the application, there are only "/" and *no* "\"

But on the other hand on sheet 1 the new filename (in the computer)
comes with "\"

But this is not a problem since I can change all those "\" that may be
present to "/" after the new filename & directories have been writen
to the txt file.

Den
Canada


Hi Den,

Hope I understand your data. Thinking a little more about this, if the
constant is the "E:" bit in the string, then it would be smarter to
use that. Hence:

=LEFT(A1,FIND("E:",A1)-1)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

is a more general solution and avoids having to worry about whether
there is a "\" or not.

Hope this gives you what you want.

Rgds






__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard Buttrey
 
Posts: n/a
Default Could I use Vlookup?

On Sun, 12 Mar 2006 23:24:35 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 17:16:04 -0500, Den wrote:

On Sun, 12 Mar 2006 18:11:55 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 18:01:10 +0000, Richard Buttrey
wrote:


This assumes there is only one "\" before the reference to the Drive
"E:" reference. If not please post back.

=LEFT(A1,FIND("\",A1)-3)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


Hi Richard,


I hope that I understand your question;

The exact strings that comes *before* all the "E:" are

cell[2].images[0].image=../../../
or
cell[32].images[0].image=../../../
or
cell[151].images[0].image=../../../


So there will always be three (3) "/" before the "E:" if I count them
all from the start of the line.

A precision may be needed: on the sheet 2 where we find the txt file
of the application, there are only "/" and *no* "\"

But on the other hand on sheet 1 the new filename (in the computer)
comes with "\"

But this is not a problem since I can change all those "\" that may be
present to "/" after the new filename & directories have been writen
to the txt file.

Den
Canada


Hi Den,

Hope I understand your data. Thinking a little more about this, if the
constant is the "E:" bit in the string, then it would be smarter to
use that. Hence:

=LEFT(A1,FIND("E:",A1)-1)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

is a more general solution and avoids having to worry about whether
there is a "\" or not.


Sorry, typo. I meant whether there is a "/" or not.

Rgds


Hope this gives you what you want.

Rgds






__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Den
 
Posts: n/a
Default Could I use Vlookup?

On Sun, 12 Mar 2006 23:24:35 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 17:16:04 -0500, Den wrote:

On Sun, 12 Mar 2006 18:11:55 +0000, Richard Buttrey
wrote:

On Sun, 12 Mar 2006 18:01:10 +0000, Richard Buttrey
wrote:


This assumes there is only one "\" before the reference to the Drive
"E:" reference. If not please post back.

=LEFT(A1,FIND("\",A1)-3)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

Rgds


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________


Hi Richard,


I hope that I understand your question;

The exact strings that comes *before* all the "E:" are

cell[2].images[0].image=../../../
or
cell[32].images[0].image=../../../
or
cell[151].images[0].image=../../../


So there will always be three (3) "/" before the "E:" if I count them
all from the start of the line.

A precision may be needed: on the sheet 2 where we find the txt file
of the application, there are only "/" and *no* "\"

But on the other hand on sheet 1 the new filename (in the computer)
comes with "\"

But this is not a problem since I can change all those "\" that may be
present to "/" after the new filename & directories have been writen
to the txt file.

Den
Canada


Hi Den,

Hope I understand your data. Thinking a little more about this, if the
constant is the "E:" bit in the string, then it would be smarter to
use that. Hence:

=LEFT(A1,FIND("E:",A1)-1)&VLOOKUP((RIGHT(A1,MATCH("\",MID(A1,LEN(A1)-ROW(1:255),1),0))),Sheet1!A2:B5,2,FALSE)

is a more general solution and avoids having to worry about whether
there is a "\" or not.

Hope this gives you what you want.

Rgds






__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________



Thank Richard for your help. I really appreciate.

Right now it doesn't work but you've given me hope that it can be
done.

I've tried to copy the formula into excel but I have no results with
CTRL+SHIFT+ENTER ; never use this combination of keys.

The formula just "sits" there in the cell and nothing appends;

I suspect that maybe I wasn't clear in my description of my data and
that some minor corrections may be needed.

I will have to struggle since this is beyond what I ever did before
with Excel.

Den






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using single cell reference as table array argument in Vlookup CornNiblet Excel Worksheet Functions 3 September 22nd 05 09:15 AM
VLOOKUP Limitations chris_manning Excel Worksheet Functions 2 August 9th 05 06:23 PM
Have Vlookup return a Value of 0 instead of #N/A Mr Mike Excel Worksheet Functions 4 May 25th 05 04:51 PM
vlookup data hidden within worksheet Excel Worksheet Functions 0 January 26th 05 12:09 PM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"