+ Reply to Thread
Results 1 to 4 of 4

How to add file name to its columns for many files

  1. #1
    Registered User
    Join Date
    08-10-2017
    Location
    india
    MS-Off Ver
    2007
    Posts
    2

    Post How to add file name to its columns for many files

    Hellow Guys,

    I am trying to solve a problem.


    Exchange is generating one data file per day, and file name contain its date like EQ01012016.xls, EQ10082017.xls and so on. this date is missing inside the file.

    I want to add date from file name to one of the column of the file. this need to be done to all the files.

    is there and smarter way then copy paste.

    I have 220 data file from stock exchange with 3000+ records each without date.


    thanks
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: How to add file name to its columns for many files

    How are you using that CSV file?

    Are you importing the data to your reporting workbook?

    It's not very efficient to update each file. I'd recommend adding column at import stage.

    Exact method will depend on how you are importing the data.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    08-10-2017
    Location
    india
    MS-Off Ver
    2007
    Posts
    2

    Re: How to add file name to its columns for many files

    yes finally all the files need to be uploaded into a database, but as the date is missing wanted to add it first.
    pls suggest the best want.

    thanks a mil

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: How to add file name to its columns for many files

    It would help if you specify what database (SQL Server, MySQL, Postgre etc) and version.

    Best approach will depend on it.

    If SQL, I'd imagine that you can query folder first, and create temp table to store file name, then loop.

    See link on how to add column with filename using Bulk Insert.
    https://stackoverflow.com/questions/...owing-filename

+ 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. Copy-Paste columns of different files into a new file
    By Guiguijo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2017, 11:58 AM
  2. [SOLVED] copy columns from individual files and paste in another excel file
    By kuntalnr in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-04-2015, 10:18 AM
  3. [SOLVED] Macro to copy selected columns and convert the file into multiple csvmsdos files
    By tanay.vinod in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2014, 03:52 AM
  4. Copy columns from multiple files into single file
    By kevincoxshall in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 02:39 PM
  5. Update master file columns with columns from slave files
    By underskinned in forum Excel General
    Replies: 1
    Last Post: 09-11-2012, 12:21 PM
  6. export columns from 3 excel files and send them to one file
    By vba_iverson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2011, 02:36 AM
  7. Extract Columns from Excel Files then Append to .CSV file
    By r0mmel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2011, 05:06 AM

Tags for this Thread

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