+ Reply to Thread
Results 1 to 5 of 5

Getting filename without extension and seperating the value based on a character

  1. #1
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Question Getting filename without extension and seperating the value based on a character

    Hi All,

    I want to develop a macro for getting filename without extension and seperating the value into two variables.

    Requirement:

    I have a folder with 3 subfolders inside.

    Each subfolder has few files in it.

    I will give main folder as input and it should check all subfolders/main folder for files and take that files and modify as shown in below example:

    Example of one file: TEST-123_REV00.pdf

    Here TEST-123 is the document name
    REV00 is the revision of the document
    pdf is as usual the extension.

    Now my requirement is to prepare an output file with all these files in a text file.

    The output is in this format..

    Document Name | Revision Name.

    Please help me in getting this done.

    Thank you.

  2. #2
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: Getting filename without extension and seperating the value based on a character

    This may help you.
    The macro creates a text file with the file and revision text.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Getting filename without extension and seperating the value based on a character

    Quote Originally Posted by G e r a r d View Post
    This may help you.
    The macro creates a text file with the file and revision text.

    Please Login or Register  to view this content.
    Hi.. Thanks for your help.. Sorry I was not clear in my first post.. For revision name I dont want REV to be added..

    Example: TEST_TOOL-123_REV00.pdf

    here you can see that there is an underscore between TEST and TOOL and also between 123 and REV

    but TEST_TOOL-123 is document name
    00 is revision.

    So my output should be

    TEST_TOOL-123 | 00

    .. Also It should process files in subfolder as well as main folder

    Thanks a lot in advance..

  4. #4
    Forum Contributor
    Join Date
    12-14-2013
    Location
    Tilburg, Nederland
    MS-Off Ver
    Excel 2010
    Posts
    256

    Re: Getting filename without extension and seperating the value based on a character

    Changed the inst check string to _R

    Also added error handling in case there is no _R in the name, the file will be skipped.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-23-2013
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    130

    Re: Getting filename without extension and seperating the value based on a character

    Thanks Gerard working as expected

+ 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. Formula to show the Filename (without path/extension) in a cell
    By acsishere in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-01-2013, 09:33 AM
  2. Windows XP : Delete extension of filename
    By london7871 in forum Microsoft Windows Help
    Replies: 3
    Last Post: 12-22-2011, 09:38 AM
  3. Excel 2007 : remove extension in header filename
    By Rob44 in forum Excel General
    Replies: 0
    Last Post: 10-24-2011, 07:07 PM
  4. Getting only the filename with no extension
    By Barry Clark in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-26-2006, 02:55 PM
  5. [SOLVED] cell character extension
    By R Smith in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-15-2005, 04:05 AM

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