Using a delimiter in a flat file

Hi People,
If I am writing a file to the PC and I have to use a delimiter '~' to seperate the values, what should I do? Can somebody give me some example or syntax?
Thanks,
AM

You can use:
CONCATENATE field1 field2 field3 INTO output SEPARATED BY '~'.

Similar Messages

  • Updating Table using the data from a flat file

    Hi,
    I have a table called emp;
    Name,
    empno,
    accountno,
    amount.
    This table is filled with values of name and empno.
    The columns accountno and amount are empty.
    I have a flat file created in some folder.
    Contents of the flat file can be like this:
    mani | 23 | 123 | 1000
    spr | 22 | 342 | 2133
    asjf | 54 | 432 | 2345
    I need to access the file in the specified location, read all the records one after the other in the flat file and update the table "emp" with the values in the flat file.
    Row after row all the records in the file should be updated to the table.
    I found out some way to do this - its sqlloader - But it loads the data from a file to the table - i dont need that - i need to update the table.
    Let me know how this can be solved ?????????
    Thanks in advance.......

    Just to clarify Andrew's point, you can use external tables as the source table for an UPDATE statement. You cannot use them as a target for an UPDATE statement (i.e. you can't update the text file from an Oracle table).
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Using ssis import a multiple flat files with different mappings

    I have an scenario for import a file
    20 different flat file source and having XML mapping document in a table.
    get files from that path(i have path and file name extension in table)
    i have map this file based on the file name extension in dynamically
    create a 20 different staging table based on mapping in dynamically
    kindly help for this
     

    Hi Karthick,
    As Arthur said, if you don't want to hard code the data flow, you need to read XML from the SQL Server table and use Script Task to implement the dynamic columns mapping. To read XML from a SQL table, you can refer to:
    http://blog.sqlauthority.com/2009/02/13/sql-server-simple-example-of-reading-xml-file-using-t-sql/ 
    In the Script Task, we need to parse the first row of the flat file to get the columns information and save that to a .NET variable. Then, the variable will be used to create the query that will be used to create SQL table. For more information, please see:
    http://www.citagus.com/citagus/blog/importing-from-flat-file-with-dynamic-columns/ 
    Regards,
    Mike Yin
    TechNet Community Support

  • Reading a semi column delimited multi line Flat file on KM repository

    Hi,
    I have a requirement in our project to read a multi line, semi column delimited flat from kept on the Knowledge Management repository and display the contents in the Portal.
    I had tried couple of options and was unable to read the file. I am not sure which are the correct APIs I should be using.
    Can any one of the experts could guide me with the sample code, that will be great!
    Your early response is highly appreciated.
    Regards
    Venkat

    here you go.
    //******* Read file from KM
    String repository_km;
    String FileURL;
    repository_km="/documents/data/data.txt";     
      try
    //Getting the user......
      IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
      IUser sapUser = wdClientUser.getSAPUser();
      com.sapportals.portal.security.usermanagement.IUser ep5User =
      WPUMFactory.getUserFactory().getEP5User(sapUser);
    //Getting the Resource.........
      IResourceContext resourseContext = new ResourceContext(ep5User);
      IResourceFactory resourseFactory = ResourceFactory.getInstance();
    //path to the KM Folder ("/documents/data/data.txt")
      RID rid= RID.getRID(repository_km);
      com.sapportals.wcm.repository.IResource resource =
      resourseFactory.getResource(rid, resourseContext);
    if (resource != null)
         String text = "";
         BufferedReader in = new BufferedReader(new InputStreamReader(resource.getContent().getInputStream()));
         int count=0;
         while ((text = in.readLine()) != null)
         strText[count] =text;
         count++;
    catch (RuntimeException e2) {
    wdComponentAPI.getMessageManager().reportException("Error in reading file from KM : "+e2.getMessage(),true);
    //                  TODO Auto-generated catch block

  • Trying to Scan in a List of Names Using a Delimiter from a Text File

    Hello everyone,
    I tried posting this question onto [Codecall Forums|http://forum.codecall.net/java-help/16064-trying-scan-list-names-using-delimiter-text-file.html] for an answer, but nobody really helped to solve this problem, so I'm reposting it here.
    I'm trying to solve this problem on the Euler Project for practice. For the first part of the problem, I am supposed to scan in names in the following format: "name1","name2","name3". To solve this, I wrote the following code:
    import java.io.*;
    import java.util.*;
    public class AlphabeticalSort
         public static void main(String args[]) throws IOException
              //import the file
              Scanner input = new Scanner(new File("names.txt"));
              input.useDelimiter("[\",]");
              System.out.println(input.delimiter());
              //scan it for the length of the array
              int n = 0;
              while (input.hasNext())
                   input.next();
                   n++;
              System.out.println(n);
              //import the names into the array
              Scanner input2 = new Scanner(new File("names.txt"));
              input2.useDelimiter("[\",]");
              String[] names = new String[n];
              for (int i=0; i<n; i++)
                   names[i] = input2.next();
                   System.out.println(names);
    }However, when I tested this with a file containing "BOB","STEVE","MARK", n equaled 7 and my output was the names each separated by two empty lines.  There are other methods I can use to solve this problem, but I would really like to know why my delimiters are not working so I can use them in the future.
    Thanks,
    helixed
    Edited by: helixed on May 14, 2009 10:52 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Take a look at [Quantifiers in Java regex|http://java.sun.com/docs/books/tutorial/essential/regex/quant.html].
    I believe "[\",]+"{code} will get you the results you need.
    Edited by: nogoodatcoding on May 15, 2009 11:54 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Split flat file column data into multiple columns using ssis

    Hi All, I need one help in SSIS.
    I have a source file with column1, I want to split the column1 data into
    multiple columns when there is a semicolon(';') and there is no specific
    length between each semicolon,let say..
    Column1:
    John;Sam;Greg;David
    And at destination we have 4 columns let say D1,D2,D3,D4
    I want to map
    John -> D1
    Sam->D2
    Greg->D3
    David->D4
    Please I need it ASAP
    Thanks in Advance,
    RH
    sql

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
    Imports System.IO
    Public Class ScriptMain
    Inherits UserComponent
    Private textReader As StreamReader
    Private exportedAddressFile As String
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
    Dim connMgr As IDTSConnectionManager90 = _
    Me.Connections.Connection
    exportedAddressFile = _
    CType(connMgr.AcquireConnection(Nothing), String)
    End Sub
    Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textReader = New StreamReader(exportedAddressFile)
    End Sub
    Public Overrides Sub CreateNewOutputRows()
    Dim nextLine As String
    Dim columns As String()
    Dim cols As String()
    Dim delimiters As Char()
    delimiters = ",".ToCharArray
    nextLine = textReader.ReadLine
    Do While nextLine IsNot Nothing
    columns = nextLine.Split(delimiters)
    With Output0Buffer
    cols = columns(1).Split(";".ToCharArray)
    .AddRow()
    .ID = Convert.ToInt32(columns(0))
    If cols.GetUpperBound(0) >= 0 Then
    .Col1 = cols(0)
    End If
    If cols.GetUpperBound(0) >= 1 Then
    .Col2 = cols(1)
    End If
    If cols.GetUpperBound(0) >= 2 Then
    .Col3 = cols(2)
    End If
    If cols.GetUpperBound(0) >= 3 Then
    .Col4 = cols(3)
    End If
    End With
    nextLine = textReader.ReadLine
    Loop
    End Sub
    Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textReader.Close()
    End Sub
    End Class
    Put this code in ur script component. Before that add 5 columns to the script component output and name them as ID, col1, co2..,col4. ID is of data type int. Create a flat file destination and name it as connection and point it to the flat file as the source.
    Im not sure whats the delimiter in ur flat file between the 2 columns. I have use a comma change it accordingly.
    This is the output I get:
    ID Col1
    Col2 Col3
    Col4
    1 john
    Greg David
    Sam
    2 tom
    tony NULL
    NULL
    3 harry
    NULL NULL
    NULL

  • Flat Files: Use of Business Content or not?

    Hello Experts,
    I am wondering, with all the extra effort in the research to identify Cubes with preferred fields for a BW project, especailly if the source is a flat file, what actually are the advantages of going through this analysis to use the SAP delivered objects.
    Thanks in advance.

    Hi Amanda,
    If you are on a project in the functional area which is already covered by SAP, then it is preferrable to make an analysis of business content objects. Even if you are going to use flat files for data upload, predelivered infosources, ODSs, cubes, TRs and URs, queries may save you a lot of time.
    Search help.sap.com for your functional area looking for infoobjects and providers. Try to evaluate if they are useful. Certainly, some knowledge in the func area is a great advantage.
    Search business content in the func area. You may even simulate BC installation. For example, choose a cube, with data flow before and after and gather objects. The scope of these objects may give your some hints to evaluate.
    If there is just one, yours, project on a BW instance, then you can use or even modify BC objects that you found. Master data loaded will not interfere with the other projects.
    If the func area of your project is not covered by SAP, then, most likely, you’ll be able to use just a few BC objects, all the others you’ll have to create.
    Sometimes, even if you are in the func area for which you’ll find predelivered objects, it’s more suitable to make copies of such objects and modify them deleting attributes that you’ll never use. Use of such standard infoobjects with many attributes may fource users to ask a lot of questions about these attributes (why, what’s this, what for etc.). Moreover, if these attributes are not used, you’ll prepare your flat files with a lot of blank fields for the attributes. Consider also an extra DB space for them.
    Doing the project almost from the scratch (with minimal usage of BC objects) will require very careful conceptual design of the data model.
    Best regards,
    Eugene

  • Flat File Destination: Broken Rows

    I am exporting data to a csv file. One of the columns has values with so mixed characters which end up confusing the system and breaking the rows before the real end of the row. What I mean is; on the flat file a resultant single row can be broken down into
    two or more rows as a result of the characters in the offending column. I work for the healthcare industry. Please see the example of what I’m talking about below. This is a real value from one of the rows in my table which I have and this value(amongst many
    more under tis column) is causing the affected row to be split into two rows. Where the letters
    OE: is coming up as a new row on my flat file. I want all this to be in the same row. My column delimiter is double dagger and my row delimiter is {CR}{LF}
    Example value:
    Column name: Comments
    Value:
    BIBA: blah blah,
    accidentally
    kicked
    brick
    wall
    to
    lateral
    aspect
    to
    R
    foot.
    reports
    hearing
    a
    crack.
    mobilised
    after
    injury.
    pain
    ++
    swelling
    +
    nil
    obvious
    deformity.
    minimal
    movement
    of
    the
    toes.
    LAS
    obs:
    entonox
    to
    good
    affect
    RR18 98%air
    P66reg 114/75
    5.3mmols
    T36.8
    pain 8-4/10
    PMH:
    Nil
    Allergies-
    nuts&prawns
    OE:
    swelling
    and
    pain
    to
    lateral
    and
    medial
    malleolus
    and 5th
    metatarsals.
    For
    xray
    Mpumelelo

    I think I have managed to get a solution to my problem.
    Instead of using csv file I have decided to use text file as my destination flat file format when exporting the data
    I have used Tab{t} as my column delimiter
    I have left the default system specified                {CR}{LF} for row delimiter
    On my flat file connection manager, I have gone to the properties and changed
    AlwaysCheckForRowDelimiters from True to False.
    After a good fight the above worked. No more broken or split rows :).
    If anyone has a better approach or suggestion it will be gladly welcome.
    Many thanks,
    Mpumelelo

  • Flat file monitoring and parsing

    I'm looking for an existing framework/open source project, which is designed to monitor a file to detect when it has changed, or just periodically check the modified date. If it detects a change in the file, then parse the file, looking for specified strings. Basically I want to monitor application log files, parsing out specified strings, then loading this information into a database.
    My first thought was looking at some ETL frameworks. I looked at a few, but I couldn't fine any that looked for strings/patterns/regex, they all used fixed width, delimited patterns for flat file processing.
    Does anyone know of any such code/framework I could utilize?
    Thanks!!

    Thanks for the response, I reviewed Apache Camel and the file polling will be useful. I also like the integration with ServiceMix, we've been looking for an open source ESB, we currently are using our "home grown" ESB.
    Looks like Camel is using the FlatPack code base for parsing. I reviewed this and also looks like a useful piece of code...something we could definitely use. However it doesn't really support string search / pattern matching parsing.....at least what I read....I'm sure I'm missed something.
    Below are examples of how we want to parse a file, and a example property file entry:
    �     Exact start point, exact end point, save text (inclusive/exclusive)
    file_name_1.parse.1=01,455,exclusive
    file_name_1.parse.2=422,500,inclusive
    �     Search string start position, save text for x number of positions
    file_name_2.parse.1=the first string,499
    �     Search string start position, search string end position, save text (inclusive/exclusive)
    file_name_2.parse.2=string1,string2,inclusive
    Any ideas for this??
    Thanks!!!

  • How to MODIFY A CUSTOM TABLE  FROM A FLAT FILE

    Dear Friends,
                     I have a requirement where i have to upload data from excel file to my custom table  so i have used a FM
    'TEXT_CONVERT_XLS_TO_SAP' and i have collected data into a internal table , till here i am able to get data correctly , now i hae to upload this data into a custom table .
    the flat file is having  6 fields and the custom table is having
    8 fields , for uploading the data into this custom table from the internal table where i have collected above iam getting problem . Actually iam using a modify statement to update the custom table .
    the flat file which i have collected into the internal table is as below :
      IDNo.     Name     Date      Location   Designation  Dept
      101       Raja      4/12/2007  Delhi      Manager      HR
      102       James    4/12/2007  Delhi      Clerk          HR
    Custom table  is having the below fields
    IDNO.  Name  Date  Location Designation  Dept   Manager
    101                                                                   Raja
    now when i run the program iam getting the problem   while usign the modify statment is the ID no which is already having
    a record as  IDno = 101  and manger = Raja.......with the other fields   name , date, location,designation and dept as blank.
    if i want to fill this fields from my flat file the modify statment
    just filling all the fields  for the ID no = 101  and manager field which already having Raja as being overwritten by space .....
    becasue this field is not being there in the flat file.
    the code iam using as follows.
    The flat file is having with the below structure
    TYPES: BEGIN OF t_emp_data,
              IDNO(11) TYPE c,
             Name(13) TYPE c,
             Date(20) TYPE c,
              Location (40) TYPE c,
             Designation(40) TYPE c,
             Dept(40) TYPE c,
             end of t_emp_data.
    The Custom Table(ZEMP_DATA) is having with the below structure
    TYPES: BEGIN OF t_emp_data_table,
              IDNO(11) TYPE c,
             Name(13) TYPE c,
             Date(20) TYPE c,
              Location (40) TYPE c,
             Designation(40) TYPE c,
             Dept(40) TYPE c,
             Manager(20) type c,  -- this is the extra field in table
             end of t_emp_data_table.
    data :
    it_empdata TYPE STANDARD TABLE OF t_emp_data,
    it_empdata_tmp TYPE STANDARD TABLE OF t_empdata_tmp,
    wa_empdata_tmp  type t_empdata_tmp,
    wa_empdata type t_emp_data.
    loop at it_empdata into  wa_empdata.
      move-corresponding  wa_empdata to   wa_empdata_tmp.
      modify ZEMP_DATA  from  wa_empdata_tmp .
    endloop.
    could any one please let me know what i have to do inorder to not get the manager field data not being overwritten with the modify statment , for the IDNo. 101  . I want the data which is already ( manager = Raja) shouldnt not be get overwritten with Space.
    please help me in this regard
    Regards
    Madhuri.

    Hi,
    use a slect statement before
    "move-corresponding wa_empdata to wa_empdata_tmp."
    select manager
    from ztable
    into wa_empdata_tmp-manager
    where id = 100.
    regards,
    lavanya

  • Flat file to XML in SAP SFTP adapter

    Hello All
    I am trying to convert flat file to xml using SAP SFTP adapter.
    Flat File is like below:
    AABEN;20141106;20141106;45;0.00
    AABOL;20141106;20141106;45;0.00
    ABGRI;20141106;20141106;45;0.00
    ADDEA;20141106;20141106;45;0.00
    ALADA;20141106;20141106;45;58.43
    AMSCH;20141106;20141106;45;0.00
    ANOLV;20141106;20141106;45;0.00
    ANROY;20141106;20141106;45;0.00
    AVMCD;20141106;20141106;45;0.00
    Message Type structure I created like below
    In Server SFTP adapter in Module tab I am using "AF_Modules/MessageTransformBean" and conversion type ="StructPlain2XML"
    I am getting error = "Error: com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Transformer Conversion3.0.5226 Error initializing Class: java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found (4408) Parameter 'xml.keyFieldName' is missing (4403) Parameter 'xml.keyFieldType' is missing (4403) ; nested exception caused by: java.lang.Exception: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found (4408) Parameter 'xml.keyFieldName' is missing (4403) Parameter 'xml.keyFieldType' is missing (4403) "
    I am not using any key field then please let me know how to overcome this issue.
    I searched on SDN but did not get any perfect answer.
    Thanks
    Dheeraj Kumar

    Hello Dheeraj,
    Thanks for your reply. I created a new discussion,
    Flatfile to XML
    Thanks well in advance for your help!
    -Satish.

  • SSIS - Exporting Data into flat files from Oracle Table as batchwise process

    Hi All,
    Thanks in advance.
    I have a Large Table in Oracle Database with some 3 Lakhs record. I need to fetch the 10,000 records for every iteration and export it into the flat file. This process should occur recursively until the table becomes empty.
    Hence, For every iteration on flat file to be generated with 10,000 records.
    Please help how to proceed further in SSIS.
    Thanks
    Pyarajan.S

    Yes, it always helps if your question doesn't specify the actual requirements...
    Use the FOR loop container to control the iterations of the data flow. For each run you read 10,000 rows from the table and dump them in a flat file. Either move the flat file, or use an expression on the flat file connection manager to give them dynamic
    file names.
    30 million rows is also not a problem by the way, it just takes a bit longer.
    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

  • Upload a flat file to BPS layout with hierarchy: is it possible?

    Hello, BPS people!
    I used a known "HowTo...using SAPGUI" to load a flat file to BPS layout. Finally I need to use a predefined layout with several variables and hierarchical representation of characteristic values in the key field ( I can't use a special layout for file uploading!). The procedure works fine if I use a flat structure of characteristic in the key field (no hierarchy). But once I choose a hierarchical representation of key characteristic in the level (but nonhierarchical model in the first screen of layout builder!) the layout data after uploading is absolutely wrong!
           1) whether is it possible to perform that without ABAP coding?
           2) If not, how can I change the function modules to use hierarchy?
    Thank you!
    Yurij

    Sorry again!
    I have solved it.
    Probably nobody understood my question. First, I have tried to attach file upload function (see "How To..load a flat file into BW-BPS using SAPGUI") to the same planning level where original planning layout with hierarchical structure in the key field already existed. But now I realized that it's impossible!
    SOLUTION: It is necessary to build the file upload function at the separated planning level with the same structure as that in the uploaded file. No hierarchies allowed in the "Selection" tab of planning level !!
    Such upload function operates perfectly in the planning folder where original layout with the hierarchical structure of key characteristic is presented. After the file upload you can perform all further activities in the planning folder (including that with uploaded data).
    Thanks,
    Yurij

  • Need help ASAP with Data Flow Task Flat File Connection

    Hey there,
    I have a Data Flow Task within a ForEach loop container.  The source of the flow is ADO.NET connection and the destination is a Flat File Connection.  I loop through a collection of strings in the ForEach loop.  Based on the string content,
    I write some data to the same destination file in each iteration overwriting the previous version. 
    I am running into following Errors:
    [Flat File Destination [38]] Warning: The process cannot access the file because it is being used by another process.
    [Flat File Destination [38]] Error: Cannot open the datafile "Example.csv".
    [SSIS.Pipeline] Error: Flat File Destination failed the pre-execute phase and returned error code 0xC020200E.
    I know what's happening but I don't know how to fix it.  The first time through the ForEach loop, the destination file is updated.  The second time is when this error pops up.  I think it's because the first iteration is not closing the destination
    file. How do I force a close of the file within Data Flow task or through a subsequent Script Task.
    This works within a SQL 2008 package on one server but not within SQL 2012 package on a different server.
    Any help is greatly appreciated.
    Thanks! 

    Thanks for the response Narsimha.  What do you mean by FELC? 
    First time poster - what is the best way to show the package here?

  • Extracting from flat file for testing inplace of ECC(r/3)

    Hi Expert,
    Please help me out and give me your suggestion.
    We are creating a custom table in ECC it is under progress.
    I would like to create infoObject, transformation, DTP and Cube and create queries with loading info by flate file. Later on connection whole provider to table.
    Give me suggestion is ther any problem for this Or any good opinion.
    Thanks in Advance

    Loading from a flat file for testing has worked well for me.  We recently wanted to test an ODS object, but I didn't want to create a custom extracter until we knew if the ODS object would work for us. So under my infoSource I created a quick infopackage that pulled some test data from a flat file.  We've loaded test data into cubes before.  Only problem that I ever had was when I used Excel to create the flat file.  Excel wants to truncate leading zeros.  0calmonth for example needs to be loaded as 072007 not 72007.

Maybe you are looking for

  • I've updated to iOS 5 and now my itouch will not sync.

    Hi There: My hard drive crashed and has recently been replaced.  I've downloaded some new songs from iTunes but now my itouch will not sync.  It states something about, "sync failed to start" but doesn't state why it failed.  I would really appreciat

  • 申請 iOS Developer Program 之 Company 版

    我想請問有關申請的問題 第14天,是甚麼算,還有甚麼樣才算成功申請

  • PSE 5: Wo ist die Online-Sicherung?

    Hat schon jemand die als Neuerung angekündigte Online-Sicherung in PSE 5 gefunden? Laut Hilfe soll die im Datei-Menü zu finden sein, allerdings nicht bei mir. Übersehe ich da was?

  • Third Party App Updates....

    I was wondering if it was possible or if there was anything like Apple Software Update for third party apps. By this I mean is there a way to get all the third party installed software such as Tweetie, VLC, Quicken, iHomework, etc. to all check for u

  • Attachments no longer show as icons in emails

    10.6.4 iMac, MacMail When I selected an attachment it used to always appear as an icon at wherever my cursor was in the email. Now it suddenly appears at the end of the message (which is nice) but is displayed all over the email so I have to right-cl