Treatment of comma-delimited file

Hi all

I need to treat more file separated by commas (example data):

' ' 'ILPS2', '2', ' ', ' 1293051491.000 ',' outward_drum ', 'top', 'T 30000025429, 22', 'V', 'PVIDC', '9', 'PVOCR', "13", "M", "3030369900545", "N", "N", "N", "N", ', 'Y', ', "N", "", "","","", "01.37", "F", "N", ",", ""
' ' 'ILPS2', '2', ' ', ' 1293051491.000 ',' outward_drum ', 'top', 'T 30000025329, 22', 'V', 'PVIDC', '8', 'PVOCR', "12", "M", "3030369900545", "N", "N", "N", "N", ', 'Y', ', "N", "", "","","", "01.37", "F", "N", ",", ""

But each column begins and ends by ". I need these characters and lead single 'data' in the columns how can I achieve this?

ODI can process fixed or delimited files.

All ideas are most appreciated.

Thank you
KS

Hi, KS,

I would like to contribute to a point.

You can manage this when creating data store.

"Go to-> your model-> open your data store-> go to the files tab-> in the text delimiter add * ' *. Save it.

PS: If its not taking "then try to create a new database. I tried with your sample data and review data when adding "as the delimiter text.

Thank you
Guru

Tags: Business Intelligence

Similar Questions

  • Using .split on an import script with a comma delimited data file

    Hi everyone-

    Any attempt to create a script to import amount field to remove the apostrophes (') of a description field to account in a .csv data import file (any folder with an apostrophe will be rejected during the import phase).  Now if it was a file delimited by semicolons (or other separators and more by commas), I could remove all the apostrophes recording with a string.replace command, then return the amount with a command of string.split.  Unfortunately, there is a problem with this solution when using comma delimiters. My data file is comma-delimited .csv file with several amount fields that have commas in them.   Even if the fields are surrounded in quotes, the .split ignores the quotes and treats the commas in fields amount as delimiters.  Therefore, the script does not return the correct amount field.

    Here is an example of a record of reference data:

    "", "0300-100000", "description of the account with an apostrophe ' ', '$1 000.00",' $1 000.00 "," $1 000.00 ","$1 000.00"," $1 000,00 "" "

    My goal is to remove the apostrophes from field 3 and return the amount in field 8.

    Some things to note:

    • If possible, I would like to keep this as an import script for amounted to simplify administration - but am willing to undertake the event script BefImport if this is the only option or more frank than the import script-based solution.
    • I tried using regular expressions, as seems to be conceptually the simplest option to respect the quotes as escape character, but think that I am not implementing properly and impossible to find examples of regex for FDMEE.
    • I know that we cannot use the jython csv on import the script by Francisco blog post - fishing with FDMEE: import scripts do not use the same version of Jython as event/Custom scripts (PSU510). This may be a factor to go with a script of the event instead.
    • It's probably a little more engineering solution, but I have considered trying to write a script to determine where to start all the quotes and the end.  Assuming that there are no quotation marks on the inside of my description of account (or I could remove them before that), I could then use the positioning of the quotes to remove commas inside those positions - leaving the commas for the delimiters as is.  I could then use the .split as the description/amount fields have no commas.  I think it may be better to create a script of the event rather than down this solution from the point of view to keep administration as simple as possible
    • Yes, we could do a search and replace in the excel file to remove the apostrophes before import, but it's no fun

    Thanks for any advice or input!

    Dan

    Hi Dan,.

    If your line is delimited by comma and quote qualified, you can consider the delimiter as QuoteCommaQuote or ', ' because it comes between each field.  Think about it like that, then simply divided by this value:

    split("\",\"")

    Here's something I put together in Eclipse:

    '''

    Created on Aug 26, 2014

    @author: robb salzmann

    '''

    import re

    strRecord = "\"\",\"0300-100000\",\"Account description with an apostrophe ' \",\"$1,000.00\",\"$1,000.00\",\"$1,000.00\",\"$1,001.00\",\"$1,002.00\""

    strFields = strRecord.split("\",\"")

    strDescriptionWithoutApos =  strFields[2].replace("'", "")   'remove the apostrophe

    strAmountInLastCol = strFields[-1:].replace("\"", "")        'You'll need to strip off the last quote from the last field

    print strDescriptionWithoutApos

    print strAmountInLastCol

    Account with an apostrophe description

    ' $1 002,00

  • MAXL to export lvl0 data in comma delemited or tab delimited file

    Greetings,

    I use Maxl take lvl0 export to the column format. But users want to export to delimited file by comma or tab delimited format.

    Is anyway to do in Maxl or shell?

    Thank you!

    Using the standard export command, the only way out is delimited by spaces. How you could get coma delimited would write a calc script and use the dataexport command.  You can specify the delimiter in who and the calc script can be run from MaxL. One thing, the dataexport specified the path command and the name for the export, or may not change as you can in the MaxL as you can for a regular export

  • Writes the schema to pipe delimited file

    Hi all

    I have to write a pipe (|) delimited file in .txt at a given location. I don't see this option in the native schema creation.

    The file must be written in the following format:
    Header1
    LINE1
    Line2
    Line 3
    .
    .
    .
    By tete2
    LINE1
    Line2
    Line 3
    .
    .
    .

    Can we write a schema for this kind of scenario?

    Here is an example for the above specified format:

    Orderno1 | Customer1. site1
    Partno1 | price1. Quantity1
    Partno2 | price2 | Quantity2
    Partno3 | price2 | Quantity1
    .
    .
    .
    Orderno2 | Customer2. site2
    Partno1 | price2 | Quantity2
    Partno1 | price2 | Quantity2
    Partno2 | price2 | Quantity3
    .
    .
    .

    Please help me.

    Thanks in advance,
    Abhishek.

    Hi Abhishek,

    You have reason there no option in the native schema Wizard to generate the ' |' separator file.

    But you can get this problem with a different approach.

    step 1: create the schema file for ',' (comma) separator through the native format Wizard.

    step 2: open the XSD file and replace ',' with ' |' option in the order of terminatedBy of each element.

    step 3: attach this XSD file updated to your outbound service (write).

    Thank you
    Praveen

    Published by: PraveenT2 on November 19, 2008 23:01

  • Advise on the treatment of raw cr2 files

    Nice day!

    I'm new shooting from raw files and are in need of some good advice & counsel to treat you in Aperture.

    My camera canon 6 d, my version of opening is 3.6.

    I import my photos to the Aperture library with selection of predefined effect 'auto-enhance', some how when I load the individual photo to see, it seems to 'do' my pictures 'dark' as compare when I saw from my camera.

    I import my image to other raw by this time deselect the "settled", same thing happens when I see the photos in Aperture.

    My questions:

    1 is this normal for the treatment of the raw files? Which means I have to make a few exposure & contrast adjustment?

    2 or is there any tips that I can learn from your part in the treatment of raw with opening files?

    3. the pictures are perfect when I saw from my camera, however, it seems somehow bit 'out' when I load in Aperture.

    Thanks to advanced tips & advise sharing.

    See you soon!

    You have a raw treatment defined in the default settings panel for your camera? Choose a raw image and leave the default value

  • problems trying to open pdf files. said the treatment works cannot open file

    original title: rayexceed

    Hi, I have problems trying to open pdf files. said the treatment works cannot open file. everything worked fine before and when it started I'm not too sure.my security is up to date when I try to open a pdf file, it says file may be damaged and then I press ok and it goes on a blank page in aid of processor.please of work

    Work does not have PDF files. You need Acrobat Reader or Foxit Reader.

  • XSD fixed and right length delimited file

    Hi all

    Using the adapter file I wanted to write a fixed length of file and the generated but the generated file is just delimited file: the fixed-length file contains (e.g..

    ............ Name... Family name

    Instead of

    Name... Last name...)

    Any suggestion, how desire out possible by file adapter or change in XSD?

    Any help appreciated.

    Thank you

    SG_SOA

    Hello

    Thank you for using nxsd:padStyle = "no |" Chief | tail"nxsd:paddedBy =" "for example"

  • regular expressions for numbers demical in a comma-delimited list


    I have a table that lists the details of the occupation of the sites of a comma-delimited list:

    create table tenure_test)
    number of site_number
    tenure_detail varchar2 (255));

    insert into tenure_test values (1, ' Crown (Other) (0.15 ha), private (555.25 ha)');
    insert into tenure_test values (2, ' private (5.76 ha)');
    insert into tenure_test values (3, ' private (0.18 ha, Crown (3.25 hectares), Indeterminate (Leased) (5.85 ha)');)

    What I want to do is to use a regular expression to calculate the sum only numbers in the tenure_detail column.

    For example, for site_number 1, it would be 0.15 + 555.25 = 555,4

    I also have another regular expression that has just the numbers in a comma-delimited list.

    For site_number 1: 0.15, 555.25

    I tried this:

    Select site_number, tenure_detail, regexp_substr (tenure_detail, "[0-9] + \.") ([0-9] {2}') under the name test1

    of tenure_test;

    but it lists only the first number.

    Hello

    996454 wrote:

    I have a table that lists the details of the occupation of the sites of a comma-delimited list:

    create table tenure_test)
    number of site_number
    tenure_detail varchar2 (255));

    insert into tenure_test values (1, ' Crown (Other) (0.15 ha), private (555.25 ha)');
    insert into tenure_test values (2, ' private (5.76 ha)');
    insert into tenure_test values (3, ' private (0.18 ha, Crown (3.25 hectares), Indeterminate (Leased) (5.85 ha)');)

    What I want to do is to use a regular expression to calculate the sum only numbers in the tenure_detail column.

    For example, for site_number 1, it would be 0.15 + 555.25 = 555,4

    I also have another regular expression that has just the numbers in a comma-delimited list.

    For site_number 1: 0.15, 555.25

    I tried this:

    Select site_number, tenure_detail, regexp_substr (tenure_detail, "[0-9] + \.") ([0-9] {2}') under the name test1

    of tenure_test;

    but it lists only the first number.

    Here's one way:

    SELECT site_number

    SUM (TO_NUMBER (REGEXP_SUBSTR (tenure_detail

    , "\d+\.\d*" - see Note 1

    ) T

    LEVEL

    )

    )

    ), Total

    OF tenure_test

    CONNECT BY LEVEL<= regexp_count="" (="">

    , '\d+\.\d*'

    )

    AND PRIOR site_number = site_number

    AND PRIOR SYS_GUID () IS NOT NULL

    GROUP BY site_number

    ;

    Output:

    TOTAL OF SITE_NUMBER

    ----------- ----------

    1 555,4

    2 5.76

    3 9.28

    Note 1: what exactly makes a 'number '?  I'm assuming it's 1 or more digits, followed by a comma, followed by 0 or more numbers.  You can have a slightly different definition; in this case, change the arguments 2nd REGEXP_SUBSTR and REGEXP_COUNT.

    I guess also that site_number is unique.  If not, you will have to change the CONNECT BY and GROUP BY clauses, to refer to something (or a combination of things) which is unique.

    Relational databases are designed for each column of each row contain 1 single piece of information, not a list delimited with a variable number of elements.  It is so basic to the design of database he called the first normal form.  If your first followed table form normal, this query (and many other queries that involve that table) would be much simpler to write, more efficient to run and less likely to have bugs.  See if you can normalize this table.  Any effort that you have to spend now to normalize the table will pay very quickly.

    Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.

    Don't forget to tell what version of Oracle you are using.  I tried the query in Oracle 11.2 above.  You may need to CONNECT BY a little differently in earlier versions, and REGEXP_COUNT will not work in Oracle 10.

  • Pipe delimited files backup

    Hi all

    I have a special requirement which States that I have to save all of the tables in my diagram as a pipe delimited file containing the names of columns and data. I know there are a lot of better ways to save, but what the requirement is. I was thinking of using the UTL_FILE package. However, as I am fairly new to the development I have very little idea about how to do it. I thought from all_tables by selecting each table and the corresponding columns of all_tab_cols and then get it inside a loop in order to export for each table through each iteration.

    I think in the right direction? Can anyone help me please with example code in order to start the thing.

    Thanks in advance for your help.

    Take a look at https://forums.oracle.com/message/11142970#11142970

    Concerning

    Etbin

  • DRCRSplit in delimited file

    Hello

    I want to ask.
    Is it possible if we use DRCRSplit in a delimited file?
    How us don't specify it?

    Example:
    Account - entity - debit - credit
    100 - HR - 100-0
    100 - HR - 0-200

    Thank you.

    No, DRCRSplit can only be used with files to width fixed.

    You will need to write an import script.

  • How to pass the line for the delimited file type?

    Hi, I want to ask you how to jump (example: the line of the first two) for delimited file type?
    Thank you...


    Here's my script
    Int NY_Skip06Center [strField, strRecord]
    '------------------------------------------------------------------
    "Script to Import DataPump FDM:
    "Created by: FDM_Admin"
    "Creation date: 28/02/2006.
    '------------------------------------------------------------------
    Dim strEntity
    'Check the first two characters of the entity.
    StrEntity = 1 to 6
    "Line break
    Res.PblnSKip = True
    Next StrEntity
    End if
    End Function

    But he returns this error when importing
    Error: An error occurred importing the file.
    Detail: Object Variable or With block variable not set

    Anyone know what is the problem

    Published by: user649207 on March 19, 2010 02:15

    Published by: user649207 on March 19, 2010 03:04

    You're overloading it.

    Your script can be this:

    Function SkipBlankAcc (strField, strRecord)

    If Trim (strField) = "" then
    Res.pblnSkip = True
    End if

    SkipBlankAcc = strField

    End Function

    If it works for you, please mark the answer as being correct others to take advantage.

  • How to display a set of results in a comma-delimited list?

    I have a query that selects an attribute in a table:
    Select the role of sport_roles

    What is the best way to display the result set as a "comma-delimited list" and "display as text"?
    for example, player, coach, referee

    Thank you.

    I think you mean comma-DELIMITED.

    The easiest way is dependent on the version. And yours is?

    In 11.1.0.6 and especially I prefer to use WM_CONCAT.
    http://www.morganslibrary.org/reference/wm_functions.html

    Tom Kyte, to asktom, provided a named function, STRAGG.

    A version number will be essential in all cases.

  • Is it possible to convert an array of values in a comma-delimited-list?

    Hello
    I want to transform the following dataset:

    Parent | Child
    ----------------------
    Charles | William
    Charles | Harry
    Anne | Peter
    Anne | Zara
    Andrew | Beatrice
    Andrew | Eugénie

    in this:

    Parent | Children
    -----------------------------
    Charles | Diana, Camilla
    Anne | Peter, Zara
    Andrew | Beatrice, Eugenie

    In other words, I would like to make a list of values from some of the major and produce them as a comma-delimited list.

    I know that his is possible in T - SQL, even if the method is a bit of a nasty hack. Is this possible in PL - SQL?

    Thaks in advance
    Jamie
    SQL>  with t  as(
     select 'Charles' parent, 'William' child from dual union
     select 'Charles', 'Harry' from dual union
     select 'Anne', 'Peter' from dual union
     select 'Anne', 'Zara' from dual union
     select 'Andrew', 'Beatrice' from dual union
     select 'Andrew', 'Eugenie' from dual
    )
    --
    --
    select parent, rtrim(xmlagg(xmlelement(e,child || ',')).extract('//text()'),',') childs from t
    group by parent
    /
    PARENT     CHILDS
    ---------- --------------------
    Andrew     Beatrice,Eugenie
    Anne       Peter,Zara
    Charles    Harry,William       
    
    3 rows selected.
    

    Don't know how Diana & Camilla suddenly jumped in many... ;)

  • How to write the comma delimited numbers of configuration file

    Hello

    In the attached Configuration File.vi write, I am trying to crush several whole decimal in the keys 1 and 2 of the attachment Test.ini. I am to convert the array of integers in a string. Because of this, the string written in the ini file is now being bracketed by apostrophes. What should I do to write the string without the apostrophes, as in the Test old.ini file?

    I appreciate your help. Thank you.

    Best regards

    Peter

    See here:

    http://forums.NI.com/T5/LabVIEW/configuration-string-keys-in-LabVIEW-2009-changes/m-p/1147371#M50489...

  • The commas of file, number of output

    Use: Oracle 10g

    I created a procedure that works well and creates an order delimited excel file. The problem is that the output is not come out correctly. When I I carry the main slider in the procedure of the output of the file looks like, but in the excel file the output is a bit wide.

    What the output SHOULD look like:
    First Name / Last Name  / Count / Zone 1 / Zone 2 / Zone 3 / Zone....
    
    Bob        /    Anderson /  0-1    / 1F,2B  /  3F,4B   /  2F,7B / ......
    What the output looks LIKE now:
    First Name / Last Name  / Count / Zone 1 / Zone 2 / Zone 3 / 
    
    Bob        /    Anderson /  0-1    / 1F       /  2B       /  3F     /  4B    /  2F  /  7B
    This is the cursor
    Cursor Konami_Pitching_Splits_Crsr is 
    select FN, LN, P_ID, Pitch_Count,
           max(case when zone=1 then results end) as Zone_1,
           max(case when zone=2 then results end) as Zone_2,
           max(case when zone=3 then results end) as Zone_3,
           max(case when zone=4 then results end) as Zone_4,
           max(case when zone=5 then results end) as Zone_5,
           max(case when zone=6 then results end) as Zone_6,
           max(case when zone=7 then results end) as Zone_7,
           max(case when zone=8 then results end) as Zone_8,
           max(case when zone=9 then results end) as Zone_9
    
    from   (
           select fn, ln, p_id, pitch_count, zone, 
                  'F'||sum(decode(pitch_type,'F',1,0))
                  ||','||
                  'B'||sum(decode(pitch_type,'B',1,0))
           as results
           from (
                select 
                  ev.pitcher_moniker as fn,
                  ev.pitcher_last_name as ln,
                  ev.pitcher_id_1032 as p_id,
                  decode(
                  p.zone,        
                  22, 1,--'Up and In',
                  23, 2,--'Up',
                  24, 3,--'Up and Out',
                  32, 4,--'In',
                  33, 5,--'Happy Zone',
                  34, 6,--'Out',
                  42, 7,--'Low and In',
                  43, 8,--'Low',
                  44, 9--'Low and Out'
                  ) as zone,
                  decode(
                  p.pitch_type_id,
                  1,'F',
                  7,'U',
                  'B'
                  ) as pitch_type,
                  Case
                  When p.balls = 0 and p.strikes = 0
                     Then 'First Pitch'
                  When p.balls = 3 and p.strikes = 2
                     Then 'Full Count'
                  Else To_char (p.balls) || '-' || to_char (p.strikes) || ' Count'
                  End as pitch_count       
                  from  customer_data.baseball_tvl_pitches p,
                        customer_data.baseball_tvl_events ev
                  where ev.event_number = p.event_number
                  and ev.game_code_1032 = p.game_code_1032
                  and ev.season = 2008
                  and p.game_type_id = 1
                  and p.game_code_1032 = ev.game_code_1032
                  and p.zone in (22,23,24,32,33,34,42,43,44)
                  order by 
                      ev.pitcher_id_1032
        )
        group by fn, ln, p_id, zone, pitch_count
        order by p_id, decode(pitch_count,'First Pitch','0--','Full Count','999',pitch_count) asc, zone
    )
    group by fn, ln, p_id, pitch_count
    order by ln, decode(pitch_count,'First Pitch','0--','Full Count','999',pitch_count) asc;
          
    Type Pitcher_Record is table of Konami_Pitching_Splits_Crsr%rowtype index by pls_integer;    
    Pitcher_Info Pitcher_Record;     
    Here's where I pulled out / open the cursor
       file_handle := utl_file.FOPEN(tFilePath, tFileName || '.tmp', 'w', 30000);
       utl_file.put_line(file_handle, 'FN    , LN    , COUNT,' ||
                                      'ZONE 1, ZONE 2, ZONE 3,' ||
                                      'ZONE 4, ZONE 5, ZONE 6,' ||
                                      'ZONE 7, ZONE 8, ZONE 9');
                                      
                                      
       Open Konami_Pitching_Splits_Crsr;
         Loop
            Fetch Konami_Pitching_Splits_Crsr Bulk Collect into Pitcher_Info limit 500;
            for ii in 1 .. Pitcher_Info.count loop
            
            Player_Tab := Pitcher_Info(ii).p_id;
    
                        utl_file.put_line(file_handle, pitcher_info(ii).fn || ',' ||
                                            pitcher_info(ii).ln || ',' ||   
                                            pitcher_info(ii).pitch_count || ',' ||
                                            pitcher_info(ii).zone_1 || ',' ||
                                            pitcher_info(ii).zone_2 || ',' ||
                                            pitcher_info(ii).zone_3 || ',' ||
                                            pitcher_info(ii).zone_4 || ',' ||
                                            pitcher_info(ii).zone_5 || ',' ||
                                            pitcher_info(ii).zone_6 || ',' ||
                                            pitcher_info(ii).zone_7 || ',' ||
                                            pitcher_info(ii).zone_8 || ',' ||
                                            pitcher_info(ii).zone_9 || ',' );
            End Loop;
            Exit When Konami_Pitching_Splits_Crsr%NotFound;
          End Loop;
        Close Konami_Pitching_Splits_Crsr;
    Published by: user652714 on November 17, 2008 09:18

    The problem is with the commas in each of the columns of the area. You will need to quote the output to prevent columns excellent interpreting these commas as separators of column.

    Just add and add a double quote to each of your columns of area:

    utl_file.put_line(file_handle, pitcher_info(ii).fn || ',' ||
                                   pitcher_info(ii).ln || ',' ||
                                   pitcher_info(ii).pitch_count || ',' ||
                                   '"'||pitcher_info(ii).zone_1 || '",' ||
                                   '"'||pitcher_info(ii).zone_2 || '",' ||
                                   '"'||pitcher_info(ii).zone_3 || '",' ||
                                   '"'||pitcher_info(ii).zone_4 || '",' ||
                                   '"'||pitcher_info(ii).zone_5 || '",' ||
                                   '"'||pitcher_info(ii).zone_6 || '",' ||
                                   '"'||pitcher_info(ii).zone_7 || '",' ||
                                   '"'||pitcher_info(ii).zone_8 || '",' ||
                                   '"'||pitcher_info(ii).zone_9 || '",' );
    

Maybe you are looking for

  • Language Pack Installation failed

    I'm running Win 7 Ultimate x 64. I tried to install as administrator, the simplified Chinese language pack. Installation, after several hours of installation time, failed. The update is now listed in my history of editing, but not in the installed up

  • HP Photosmart D5360: I think I have the wrong cable to my printer

    I'm sorry I'm hogging this forum with a deluge of questions, but I may have found the problem.  The cables are the Staples store and they are probably not good. My mother has had this printer before I got it and I don't remember him having to replace

  • How to install the raid without floppy drive drivers

    I am building my own computer and I want to run Win XP Pro SP3 and Windows 7 64-bit.  The only reason why I'm eager to keep XP is that several of my old programs that I use, are not compatible with Windows 7.  I know that XP is sometimes "fussy" abou

  • Calls of blackBerry Smartphones Blackberry problems

    OK, so I sound, I got a SMS message with sound, so I know that works. But when I try to make a call or receive a call, I hear nothing. It's as if the phone is off. But I hear the little connect sound. It drives me crazy, I don't know what it could be

  • Software of blackBerry OS 5 Smartphone keyboard lock?

    After the new OS 5 update, I noticed that there is no convience key "lock keyboard". Instead, it is a key to reading/silent on my Blackbery Curve 8520. I was just wondering if there is is no longer included or if I could just download on my DM. Thank