+ Reply to Thread
Results 1 to 5 of 5

Extract path names from list of full pathnames

  1. #1
    Registered User
    Join Date
    11-08-2016
    Location
    Netherlands
    MS-Off Ver
    Excel for Mac 15.32, English version
    Posts
    26

    Extract path names from list of full pathnames

    Hi, hopefully, someone can help me with the following. I have a sheet containing the paths and filenames of a large number of .jpg files. Now I want to extract only the path of each file.

    I have already split path names into columns. So if I could delete the last cell of each line, my problem would be solved. The number of subdirectories is not the same for all files. Hence, removing one ("last") column of the sheet will not work.

    I'm using Excel for Mac, v. 16.43.

    Thanks in advance for any pointers.
    Last edited by Szyfrow; 05-06-2022 at 04:35 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Extract path names from list of full pathnames

    This would be easier to help with if you shared a sample file.

    Likely find the last / in the string and return everything up to that point...

    Are you doing this in VB? where are the directory listings coming from... can you not parse it out there?
    -If you think you are done, Start over - ELeGault

  3. #3
    Registered User
    Join Date
    11-08-2016
    Location
    Netherlands
    MS-Off Ver
    Excel for Mac 15.32, English version
    Posts
    26

    Re: Extract path names from list of full pathnames

    Thanks for your reply, ELeGault. See the attached sample file. The listing is coming from the Terminal command:
    find . -name "*.jpg" > list.txt.
    I am not so good at processing via the command line. Therefore I'd rather use Excel. However, I only got halfway there.

    Of course, suggestions for the alternative of command-line processing would also be welcome!
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,430

    Re: Extract path names from list of full pathnames

    We might be in a better position to help if we could see manual mockups of the results you want.
    That said perhaps the following will yield the desired results in rows 7:10 with the final results being in cells Q7:Q10
    =IF(AND(B1<>"",ISERROR(SEARCH("jpg",B1))),A7&IF(COLUMN()=2,"","/")&B1,A7)
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    11-08-2016
    Location
    Netherlands
    MS-Off Ver
    Excel for Mac 15.32, English version
    Posts
    26

    Thumbs up Re: Extract path names from list of full pathnames

    Hi JeteMc, this really seems to be the result I need. Tomorrow I will look at it in more detail and try your formula out on my actual data. You will hear the result from me, of course. Thanks very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extract external workbook full path from formula
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-29-2019, 02:50 PM
  2. [SOLVED] Power Query - Extract FileName for Full Path in Cell
    By jgarza0422 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2019, 10:20 AM
  3. Replies: 1
    Last Post: 11-18-2016, 03:33 PM
  4. Extract full name from path and open it (or not)
    By Remphan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2016, 03:36 AM
  5. Search a range Last Names for age & return the value to a List of FULL NAMES
    By LunarLights in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-16-2014, 05:02 PM
  6. extract filename from full path
    By Leung in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-03-2005, 06:05 PM
  7. Recurring Problems with Links with Full Path Names
    By JMcBeth in forum Excel General
    Replies: 2
    Last Post: 02-04-2005, 08:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1