BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Want to sponsor BOB? 
Want to sponsor BOB? (Opens a new window)  

General Notice: No events within the next 45 days.

Accessing the filename when importing


 
Search this topic... | Search DI: Designer and Job Design... | Search Box
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Author Message
fblau
Principal Member
Principal Member



Joined: 07 Feb 2005

Posts: 220



PostPosted: Mon Feb 07, 2005 11:50 am 
Post subject: Accessing the filename when importing

If I use a wildcard variable to get all the files in a folder, is there any way to access the name of file that is currently being processed?

Thanks for a great forum!
Back to top
Dwayne Hoffpauir
Forum Groupie
Forum Groupie



Joined: 19 Sep 2002
ASUG Icon
medal_gold.gif*2speaker.gif*5medal_bronze.gif
Posts: 8644
Location: Plano, TX USA


flag
PostPosted: Mon Feb 07, 2005 1:31 pm 
Post subject: Re: Accessing the filename when importing

fblau wrote:
If I use a wildcard variable to get all the files in a folder, is there any way to access the name of file that is currently being processed?

Thanks for a great forum!

The VBA Dir command is what you are after. Try something like this:
Code:
Yourfile = Dir("file path including wildcard")
Do Until Yourfile = ""
    'process Yourfile
    Yourfile = Dir
Loop

The first use of Dir (with the path) will "seed" the matching filename. Subsequent uses of Dir (without the path) will get the next matching filename.

_________________
Dwayne Hoffpauir
Image link
Back to top
fblau
Principal Member
Principal Member



Joined: 07 Feb 2005

Posts: 220



PostPosted: Mon Feb 07, 2005 1:36 pm 
Post subject: Re: Accessing the filename when importing

I'm sorry, I should have been more specific...

In Data Integrator, I am using a wildcard in the File Format object.

When processing the file(s), I would like to have the name of the file to insert into the row too.

Does that make sense?
Back to top
Dwayne Hoffpauir
Forum Groupie
Forum Groupie



Joined: 19 Sep 2002
ASUG Icon
medal_gold.gif*2speaker.gif*5medal_bronze.gif
Posts: 8644
Location: Plano, TX USA


flag
PostPosted: Mon Feb 07, 2005 1:45 pm 
Post subject: Re: Accessing the filename when importing

My apologies as well. I read it as a SDK question. I can't help with DI.
_________________
Dwayne Hoffpauir
Image link
Back to top
Werner Daehn
Forum Devotee
Forum Devotee



Joined: 17 Dec 2004

speaker.gif*6
Posts: 10591
Location: Germany


flag
PostPosted: Tue Feb 08, 2005 4:00 am 
Post subject: Re: Accessing the filename when importing

Today your only option is to execute a "dir" like command, remember the list of files somewhere and than read this list in a while-object reading each file separate. Support should have some ATL to demo.

This feature request is on the list for one of the next releases but that will take some time.

_________________
Werner Daehn
Product Manager Data Services
SAP AG
�The opinions expressed in this post are my own views and not those of SAP.�
Back to top
fblau
Principal Member
Principal Member



Joined: 07 Feb 2005

Posts: 220



PostPosted: Tue Feb 08, 2005 4:26 am 
Post subject: Re: Accessing the filename when importing

Which is exactly what I ended up doing...

Seems like it's not the fastest way to go... but it does give me some nice options for parsing things out of the filename...

For 1000 rows/file it's about 5 seconds per file.
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0282 seconds using 17 queries. (SQL 0.0028 Parse 0.0009 Other 0.0245)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo