How to include the file name as an XML field

Hi,
I'm using a file adapter for process a flat file and convert it into an XML. Does anybody knows how to include the file name into an XML field.
Ex.
I process the file named <b>XXIMN21022007.txt</b> and I need an XML like:
<MT_FILE>
<field1></field1>
<field2></field2>
<field3></field3>
<filename><b>XXIMN21022007.txt</b></filename>
</MT_FILE>
Regards
Gonzalo

Just go for dynamic configuration.
Check the sender file adapter to write the filename in the header (as explained in Michal's blog) and then read that header in some mapping.
U can use that even in simple message mappings.
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
Your code for the filename tag would be something like:
<i>DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
    “http://sap.com/xi/XI/System/File”,
    “FileName”);
return conf.get(key);</i>
Regards,
Henrique.

Similar Messages

  • How to include the file name in CV02N-change document in application field

    Hi
    Can anyone tell me what are the settings to be made in Document management system so that i'm able to change the application name(now if its an excel file its showing as excel file,instead of that,is it possible to change and give some name or description against that?)
    Suitable points will be rewarded.
    Thanks & regards
    Karthik.

    Hi Karthikraj,
    Do you want to change only in CV02N?
    i.e. only the description
    In Originals area below what you see are:
    <b>Appl</b>    <b>Application</b>      <b>Storage Cat</b>   then <b>Lock symbol</b>
    If you want to Change in "Application" just select and Right click on it you will see a details click on it and change the description you want ! thats it!
    If you want to change in "Appl." the you should follow the procedure what i told you previously.
    Try it both you will get any idea.(because i have done both, & its working fine)
    Regards
    Rehman

  • File name as an XML field

    Does anybody knows how to include the file name into an XML field. My scenario is  XML file to JDBC. I have to pass the filename as one of the table field.

    Hi,
    refer this weblog for dynamic configuration https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2664. [original link is broken] [original link is broken] [original link is broken]
    It will show how to include the file name.
    Also you can use that even in simple message mappings.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    regards
    Aashish Sinha
    PS : reward points if helpful

  • How to print the file name in sap

    Hi All,
    I have requirment like,
    there is a folder in my local system, inside that folder there are 10 Excel file like file1.xls,file2.xls..............file10.xls
    how to print the file name of all these file in SAp like
    file1.xls
    file2.xls
    file3.xls
    file4.xls
    file10.xls
    Appropriate points will be rewarded.
    Thanks in Advance
    Arun kumar

    Hi,
    Still you are facing any problem with this code expalin the problem with details , otherwise close this thread.
    Use Method <b>cl_gui_frontend_services=>directory_list_files</b> to read file names for a given directory
    after reading the files then Use FM : <b>RSPO_SX_OUTPUT_TEXTDATA</b> to create spool from internal table data and print the data.
    <b>sample code :</b>
    data: desktop_dir type string.
    data: ifiles type table of string.
    data: xfiles type string.
    data: count type i.
    data: filepath type string.
    call method cl_gui_frontend_services=>get_desktop_directory
      changing
        desktop_directory    = desktop_dir .
    call method cl_gui_cfw=>flush.
    call method cl_gui_frontend_services=>directory_list_files
      exporting
        directory                   = desktop_dir
    *    filter                      = '*.xls'
         files_only                  = 'X'
    *        DIRECTORIES_ONLY            =
      changing
        file_table                  = ifiles
        count                       = count.
      DATA : x_name       LIKE tsp03d-name,
             x_dest       LIKE tsp03d-padest VALUE 'LOCL',
             x_rows       LIKE sxpcklsti1-body_num VALUE 0,
             x_startrow   LIKE sxpcklsti1-body_start VALUE 1,
             x_pages      LIKE rspotype-pages VALUE 1,
             x_pages_1    TYPE p DECIMALS 2,
             x_rqtitle    LIKE sxpcklsti1-obj_descr,
             x_rqcopies   TYPE i VALUE 1,
             x_rqowner    LIKE trdyse01cm-username,
             x_immediate  LIKE pri_params-primm VALUE ' ',
             x_rqid       LIKE tsp01-rqident,
             i_contents    LIKE  solisti1 OCCURS 0 WITH HEADER LINE,
          x_pages   = 1.
          x_rqowner = sy-uname.
          x_dest     = 'LOCL'.
          x_startrow = 1.
          x_rqcopies = 1.
          x_immediate = 'X' .
          CALL FUNCTION 'RSPO_SX_OUTPUT_TEXTDATA'
           EXPORTING
    *       name                 =   x_name
             dest                 =  x_dest
             rows                 =  x_rows
             startrow             =  x_startrow
             pages                =  x_pages
             rqtitle              =  x_rqtitle
             rqcopies             =  x_rqcopies
             rqowner              =  x_rqowner
             immediately          =  x_immediate
           IMPORTING
             rqid                 =  x_rqid
           TABLES
             text_data            = i_contents
           EXCEPTIONS
             name_missing         = 1
             name_twice           = 2
             not_found            = 3
             illegal_layout       = 4
             internal_error       = 5
             size_mismatch        = 6
             OTHERS               = 7.
          IF sy-subrc <> 0.
    ** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    **         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Regards
    Appana
    *Reward Points for helpful answers
    Message was edited by: L Appana

  • How to put the file name in notepad file

    dear frank,
    how to put the file name in notepad file via power shell. I mean i want to put the file name in that notepad file
    for example,
    my file name is ABL and in this file data is
    02/06/2015,180.00,182.00,176.01,180.50,1575500
    02/06/2015,4.20,4.20,4.20,4.20,500
    02/06/2015,113.50,113.70,112.91,113.09,157800
    02/06/2015,682.01,695.90,682.00,683.19,4250
    02/06/2015,213.98,215.00,213.00,214.87,326200
    02/06/2015,21.52,21.65,21.52,21.60,4000
    02/06/2015,111.00,111.25,108.25,108.91,17100
    02/06/2015,52.00,52.00,52.00,52.00,500
    and i want to data in this form
    ABL,02/06/2015,180.00,182.00,176.01,180.50,1575500
    ABL,02/06/2015,4.20,4.20,4.20,4.20,500
    ABL,02/06/2015,113.50,113.70,112.91,113.09,157800
    ABL,02/06/2015,682.01,695.90,682.00,683.19,4250
    ABL,02/06/2015,213.98,215.00,213.00,214.87,326200
    ABL,02/06/2015,21.52,21.65,21.52,21.60,4000
    ABL,02/06/2015,111.00,111.25,108.25,108.91,17100
    ABL,02/06/2015,52.00,52.00,52.00,52.00,500
    There are many file like this that i want to be edit
    plese tell me how can i do it, i think it is possible via windows power shell.
    thanks in advance.

    Hi
    Just for completeness, what version of VB.NET are you using?
    Here is a complete project to copy all the files with the added "ABL," at the start of each line.  You need to start a new Project with a BLANK default Form1, and replace all of Form1 code with the code below. When you run this project, you
    need to use the 2 buttons to set up the ORIGINAL file folder and a folder to place the copies. You need to check if the file EXTENSION is correct (I assumed txt), and check the text to add to each line is correct.  Once all is set up you should have a
    big red button to start the operation.
    NOTE: it is important that you try this out on a copy of some of the files to verify accuracy BEFORE trying on original files. Make sure you have a good back up of the original files before doing anything else.
    ' new project with default BLANK Form1
    ' replace all Form1 code with this code
    ' WARNING: make sure you have a backup of
    ' any files you use this application to
    ' operate on.
    Option Strict On
    Option Infer Off
    Option Explicit On
    Public Class Form1
    Dim OrigFileFolderPath As String = Nothing
    Dim CopyToFolderPath As String = Nothing
    Dim lab1, lab2, lab3 As New Label
    Dim tb1, tb2, tb3 As New TextBox
    Dim b1, b2, b3, b4 As New Button
    Dim fb As New FolderBrowserDialog
    Dim bgw As New System.ComponentModel.BackgroundWorker
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Me.Size = New Size(731, 300)
    With lab1
    .Text = "Original Files Folder Path"
    .Location = New Point(15, 5)
    End With
    With tb1
    .Width = 560
    .Location = New Point(10, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab2
    .Text = "Copy Files to Folder Path"
    .Location = New Point(15, 125)
    End With
    With tb2
    .Width = 665
    .Location = New Point(10, 150)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab3
    .Text = "File Ext"
    .Location = New Point(600, 5)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With tb3
    .Text = ".txt"
    .Width = 80
    .Location = New Point(590, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .TextAlign = HorizontalAlignment.Center
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With b1
    .Text = "Choose Original Files Folder Path"
    .AutoSize = True
    .Location = New Point(10, 65)
    End With
    With b2
    .Text = "Choose Copy Files to Folder Path"
    .AutoSize = True
    .Location = New Point(10, 185)
    End With
    With b3
    .Text = "DO THE COPY"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    With b4
    .Text = "CANCEL JOB"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    Me.Controls.AddRange({lab1, lab2, lab3, tb1, tb2, tb3, b1, b2, b3, b4})
    With bgw
    .WorkerReportsProgress = True
    .WorkerSupportsCancellation = True
    End With
    AddHandler bgw.DoWork, AddressOf bgw_DoWork
    AddHandler bgw.RunWorkerCompleted, AddressOf bgw_Completed
    AddHandler b1.Click, AddressOf b1_Click
    AddHandler b2.Click, AddressOf b2_Click
    AddHandler b3.Click, AddressOf b3_Click
    AddHandler b4.Click, AddressOf b4_Click
    End Sub
    Private Sub b1_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = False
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb1.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b2_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = True
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb2.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b3_Click(sender As Object, e As EventArgs)
    b3.Visible = False
    b4.Visible = True
    If Not tb3.Text.StartsWith(".") Then tb3.Text = "." & tb3.Text
    bgw.RunWorkerAsync()
    End Sub
    Private Sub b4_Click(sender As Object, e As EventArgs)
    bgw.CancelAsync()
    End Sub
    Private Sub ReadPWFile(fn As String)
    Dim filename As String = My.Computer.FileSystem.GetName(fn)
    Dim barename As String = IO.Path.GetFileNameWithoutExtension(fn)
    Dim copyto As String = tb2.Text & "\" & filename
    Dim line As String = Nothing
    Dim lines As New List(Of String)
    Using sr As IO.StreamReader = New IO.StreamReader(fn)
    Do
    line = sr.ReadLine()
    If Not line = Nothing Then
    lines.Add(barename & "," & line)
    End If
    Loop Until line = Nothing
    End Using
    Using sw As IO.StreamWriter = New IO.StreamWriter(copyto)
    For Each s As String In lines
    sw.WriteLine(s)
    Next
    End Using
    End Sub
    Private Sub bgw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs)
    Dim ftc As Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(tb1.Text)
    For Each f As String In ftc
    If bgw.CancellationPending Then
    e.Cancel = True
    Exit For
    End If
    Dim ex As String = My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower
    If My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower = tb3.Text.ToLower Then
    ReadPWFile(f)
    End If
    Next
    End Sub
    Public Sub bgw_Completed(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs)
    tb1.Text = Nothing
    tb2.Text = Nothing
    b3.Visible = False
    b4.Visible = False
    MessageBox.Show("Finished copying files", "Job Completed")
    End Sub
    End Class
    Regards Les, Livingston, Scotland

  • How to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    how to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    Within Aperture you have Images, which are constructed on-the-fly from two files (the Master and the Version).  You get an image-format file _only_ when you export an Image.  You select the file name (usually a scheme) when you create an image-format file (that is, when you export).  Look under "Aperture→Presets→File Naming" for built-in Presets.  You can, of course, create your own or customize any provided.
    The Preset is applied to only the file newly created by your "export" command.  It is not applied to the Image in Aperture (unless you rename your Versions or your Masters).

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

  • I can not download any files using Safari ? when I choose to download application file the URL include the file name and stop responding. Any help??

    I can not download any files using Safari ? when I choose to download application file the URL include the file name and stop responding. Any help??

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. The Guest login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    *Note: If FileVault is enabled under Mac OS X 10.7 or later, you can’t boot in safe mode.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Can I include the FILE NAME when printing from Bridge?

    I'm a commercial photographer. I shoot with my camera tethered to a Mac laptop to view images immediately as I shoot. I use Bridge to view these images.
    As I shoot, we save the file by product name, and then print proofs immediately. I need to include the File Name on these prints. Is
    there a way for me to do this directly from Bridge? If not, can you think of a way using Photoshop? Or anything else? Lightroom?

    Guessing you are using Bridge CS4 you could use the Adobe Output module for
    this. It is reachable through a seperate workspace in the top menu right
    side or the left side top menu the icon most right.
    You can create different lay outs as a PDF with this but for you it should
    be one per page and select the filename (with or without extension). Just
    explore the posibilities. For CS4 you could use the updated Output Module.
    If on CS3 you could use the contact sheet script for Photoshop that in
    Bridge can be reached by the menu Tools / Photoshop / contactsheet. This
    contactsheet script is also usable for CS4, it is on the Goodies install
    disk for PSCS4
    As I shoot, we save the file by product name, and then print proofs
    immediately. I need to include the File Name on these prints. Is
    there a way for me to do this directly from Bridge? If not, can you think of a
    way using Photoshop? Or anything else? Lightroom?

  • How to insert the file name to column

    When user upload the file, in order to avoid the double file name conflict, so I need to  change the file name to something else, but I still need save the former file name to some column to download the file with correct file name, I know how to rename and upload file, but I don't know how to catch the file name and save it to some column when using addt insert transaction?

    Hi,
    As I said earlier, you have to maintain the list of filename's "itemdescr" in different temp file and load it an and when required table instead of checking for round robin functionality. If you are looking forward that oracle sqlldr can able to access the filename as one of the parameter then - it might not possible AFAIK.
    else perform the direct insert on the table from sqlclient.
    - Pavan Kumar N

  • How to Capture the File Names of any extension using ssis

    Hello,
    Can you please let me know on how to Capture the File Names of any extension(EG : xls,text,.csv etc) at a time  and stores in excel file  using SSIS?
    Any help would be appreciated.
    Thanks,
    Vinay s

    If you need to act differently on each file type separately or if not all types of files are wanted, i.e. the Filespecifier cannot be *.* in the Foreach loop:
    In the ssis package
    make 3 variables:
    to store the file extension, e.g. User::CurrentExtension of type string
    to store the filename found in the directory: @CurrentFilename
    to store the name of the directory where the files reside e.g. User::CurrentDirectory
    make a foreach loop of type Foreach Item enumerator:
    in the items list you add each file extension that you need
    txt
    csv
    xls
    xlsx
    As Variable mappings map the CurrentExtension to Index 0
    Inside this foreach loop add another foreach loop of type Foreach File enumerator, in the collection Expressions
    add Expression Directory , set to @[User::CurrentDirecotry]
    add Expression FileSpec, set to "*." + @[User::CurrentFileExtension]
    In the Variable mappings, map Variable user::CurrentFilename to Index 0
    Inside this loop use Execute SQL Task to insert the filename in a Excel connection.
    Jan D'Hondt - SQL server BI development

  • How OSB archive the file name

    How OSB archive the file name?
    I have used JCA adapter to archive file while reading in OSB and OSB does archive the file with different name.
    But OSB is creating the file with name as understandable form. Is it possible to give my own defined name while archiving the file(s).
    Please help me !
    -Thanks

    I dont think it is possible to change the names of the archive files once OSB processes the file. I haven't found any references of the same in the JCA adapter documentation as well.
    You can check with Oracle support if this is feasible.
    Thanks,
    Patrick.

  • MessageFileUpload how to retrive the file name?

    Hi there guys,
    maybe it's a stupid question but i cannot find the answer :_( any of you knows how to retrive the file name i am going to upload from the messageFIleUpload item?
    Thank You, Pier Paolo.
    Edit: Found in another post!! eeheh LAZY ME!! :_)
    Message was edited by:
    PandreoL

    Nice to know that you found the solution. You could have as well used the javadoc for the same.
    --Shiv                                                                                                                                                                                                                   

  • Question on how to Hide the User Name, Password, and Domain fields in the MDT Wizard

    MDT 2012 U1
    Deploying Windows 7 via Offline Media (ISO) to MS Virtual PC's
    I am looking on how to Hide the User Name, Password, and Domain fields which are prepopulated in the MDT wizard via the CS.ini (Not so concerned about the Domain field as I am User Name and Password)
    We do need the Computer Name and OU fields to be seen, so skipping the wizard is not a option
    The client just does not want these fields to be seen by the end users, they dont want them to even know the account name used for adding the machine to the domain, of course the password is not displayed but it must not be displayed either.
    But since we use the fields they must still  be fuctional just not seen.
    Thanks.....
    If this post is helpful please click "Mark for answer", thanks! Kind regards

    You shouldn't have to edit DeployWiz_Definition_ENU.xml. You should only need to add "SkipAdminPassword=YES" to the CS.ini file and your authentication information.
    Example:
    [Settings]
    Priority=Default
    Properties=MyCustomProperty
    [Default]
    OSInstall=Y
    SkipCapture=NO
    SkipAdminPassword=YES
    UserID=<MyUserID>
    UserPassword=<MyPassword>
    UserDomain=<MyDomain.com>
    SkipProductKey=NO
    SkipComputerBackup=YES
    SkipBitLocker=NO
    -Nick O.
    Nick,
    SkipAdminPassword=YES is for:
    You can skip the Administrator Password wizard page by using this property in the
    customsettings.ini.
    I am hidding the Username/Password/and domain field in the computer name Wizard pane which is read from the cs.iniDomainAdmin=xxxxx
    DomainAdminPassword=xxxxx
    DomainAdminDomain=xxxxxx
    JoinDomain=xxxxxx
    If this post is helpful please click "Mark for answer", thanks! Kind regards

  • Import From Folder: How to Extract the File Name in a Custom Column.

    Hello All
    Here´s what we´re trying to do:
    We have a folder with csv files named like this:
    Sales_2013-02-05.csv
    Sales_2013-02-04.csv
    Sales_2013-02-03.csv
    Sales_2013-02-02.csv
    Sales_2013-02-01.csv
    And in the csv files there are the sales columns but not the date column.
    So we want to extract the date from the file name.
    I´ve tried entering = Source[Name] in a custom column, but it adds a "LIST" link, and on a click on expand, it adds ALL file names from the folder in each row, instead of just the needed one.
    If we could get the proper file name in each row (from where they got extracted), we could split the column and get the date from there. But I don´t know how put the filename there properly.
    Can you help?

    This isn't entirely straightforward, but it's definitely possible. What you need to do is to apply all of your transforms to each individual file instead of the combined files. I do that as follows:
    1) Use Folder.Files as generated by the GUI to look at the list of my files.
    2) Pick one file and do all the transformations to it that I want to apply to all of the files. Sometimes, this just amounts to letting the autodetection figure out the column names and types.
    3) Go into the advanced editor and edit my code so that the transformations from step 2 are applied to all files. This involves creating a new function and then applying that function to the content in each row.
    4) Expand the tables created in step 3.
    As an example, I have some files with names that match the ones you suggested. After steps 1 + 2, my query looks like the following:
    let
        Source = Folder.Files("d:\testdata\files"),
        #"d:\testdata\files\_Sales_2013-02-01 csv" = Source{[#"Folder Path"="d:\testdata\files\",Name="Sales_2013-02-01.csv"]}[Content],
        #"Imported CSV" = Csv.Document(#"d:\testdata\files\_Sales_2013-02-01 csv",null,",",null,1252),
        #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
        #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
    in
        #"Changed Type"
    For step 3, I need to take steps 3-5 of my query and convert them into a function. As a check, I can apply that function to the same file that I chose in step 2. The result looks like this:
    let
        Source = Folder.Files("d:\testdata\files"),
        Loader = (file) =>
            let
                #"Imported CSV" = Csv.Document(file,null,",",null,1252),
                #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
                #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
            in
                #"Changed Type",
        #"d:\testdata\files\_Sales_2013-02-01 csv" = Source{[#"Folder Path"="d:\testdata\files\",Name="Sales_2013-02-01.csv"]}[Content],
        Loaded = Loader(#"d:\testdata\files\_Sales_2013-02-01 csv")
    in
        Loaded
    Now I apply the same function to all of the rows, transforming the existing "Content" column into a new value:
    let
        Source = Folder.Files("d:\testdata\files"),
        Loader = (file) =>
            let
                #"Imported CSV" = Csv.Document(file,null,",",null,1252),
                #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
                #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
            in
                #"Changed Type",
        Transformed = Table.TransformColumns(Source, {"Content", Loader})
    in
        Transformed
    Finally, I need to expand out the columns in the table, which I can do by clicking on the expand icon next to the Content column header. The resulting query looks like this:
    let
        Source = Folder.Files("d:\testdata\files"),
        Loader = (file) =>
            let
                #"Imported CSV" = Csv.Document(file,null,",",null,1252),
                #"First Row as Header" = Table.PromoteHeaders(#"Imported CSV"),
                #"Changed Type" = Table.TransformColumnTypes(#"First Row as Header",{{"One", Int64.Type}, {"Two", type text}, {"Three", type text}})
            in
                #"Changed Type",
        Transformed = Table.TransformColumns(Source, {"Content", Loader}),
        #"Expand Content" = Table.ExpandTableColumn(Transformed, "Content", {"One", "Two", "Three"}, {"Content.One", "Content.Two", "Content.Three"})
    in
        #"Expand Content"
    From here, you should be able to get to what you want.

Maybe you are looking for

  • Problem with store app in nokia 302

    i can't open store app in my nokia 302 after i restore the phone , when i try to open ,it just open for 2 sec. Then close automatically

  • Connecting to a wlc across subnets

    I have recently purchased a 4402 wireless controller to manage our access points. When I put the APs on the same subnet as the ap-manager subnet I get the ap to connect. When I put the ap on the wireless subnet, it will not connect. Does not even reg

  • I cannot get iPhoto to open.

    I did update my iPhone last week while I was out of town.  I have check all updates on the computer today and rebooted it several times.  iPhoto will not open. Any suggestions??

  • Uninstalled Acrobat Pro (part of CS 5.5 Design Standard) and now need to reinstall. How??

    I am so confused. I have CS 5.5 Design Standard running on a Windows 7 computer. I have the serial number. The problem is, I stupidly uninstalled Acrobat Pro and now need to reinstall it. What do I do? I downloaded Acrobat Pro X from the download lin

  • Adobe audition cs6 stops exporting mixdown at 50%

    AA CS6 will stop exporting a mixdown at 49% sometimes 50%.  Any suggestions?   I have been using AA for a few years now and this is the first time I have had this issue.