Multiple column in the file

the file record have 4 field and storing the records in string[]
record=bufferedReader.readLine();
String[] str = record.split("    ");  
System.out.println(str[2]);These code will print the 3 column of the file but if we want to read each element of str[2]; then how to do that

When you call split, everything from the start to the delimiter is stored in the array. Then delimiter itself is not. So, :
     public static void main(String[] args) {
          String test = "\"Larry\",\"Moe\",\"Curly\"\t1234,5432,97854";
          String [] arr = test.split("\t");     //Split the test string at any tab
          for(String s : arr)
               System.out.println(s);
          String [][] arr2 = new String[arr.length][];
          for(int i = 0; i< arr.length; i++){
               arr2[i] = arr.split(","); //loop thru the array created by the first split, and split it at any comma
               for(int j = 0; j<arr2[i].length; j++)
                    System.out.println("\t" + arr2[i][j]);
Of course, this will only work if you know the format of the data, but since you need the format to start with, then you should easily be able to figure it out.
~Tim

Similar Messages

  • How to fetch the Date column(or Month column) from the file name from the specified path in ODI 11g

    Hi ALL,
    Can any one help us regarding How to fecth the Date column(or month column) from the file name specified in the path in a generalized way .
    For example :
    file name is :subscribers (Cost) Sep13.csv is specified in the below path
      E:\Accounting\documents\subscribers (Cost) Sep13.csv
    here I need to fetch the "Sep13" as a Date column in the ODI 11g in the generalized way.
    Can any one help us in this case as early as possible.

    I would suggest using a piece of Jython code for this.  Something like this...
    import os
    import os.path
    filelist  = os.listdir(E:\Accounting\documents\)
    for file in filelist:
    datestr = file[19:-4]
    You'd need to work out what to do with datestr next...  perhaps write it to a table or update an ODI variable with it.
    Hope this is of some help.

  • Multiple columns in the Welcome page

    How can I create multiple columns in the Welcome page like Stanford's and Duke's?

    Stanford and Duke are super special sites that have access to experimental iTunes U layouts. They take all the risks so we don't have to.
    It's been covered before in this forum, but the good news is that we might, one day, have access to the same layout.

  • JoinRowSet : Multiple Columns as the MatchColumn

    Hi All,
    RE: JoinRowSet : Multiple Columns as the MatchColumn
    I spent one day and have been trying to join two tables with two columns as a JOIN match... cannot made anything work. I read all the doc and the JDBC RowSet Implementations Tutorial doesn't really help a lot.
    Any example will be appreciated.
    Connection con = DriverManager.getConnection(dbUrl,dbUserId,dbPasswd);
    Statement stmt8 = con.createStatement();
    ResultSet rs = stmt8.executeQuery("select project_id, bld_id, bld_name from table1");
    Statement stmt10 = con.createStatement();
    ResultSet rs3 = stmt10.executeQuery("select project_id, bld_id, project_name from table2");
    CachedRowSet crs3 = new CachedRowSetImpl();
    crs3.populate( rs);
    System.out.println("Size of the first cached rowset is:: "+crs3.size());
    CachedRowSet crs4 = new CachedRowSetImpl();
    rs.beforeFirst();
    crs4.populate( rs);
    System.out.println("Size of the first cached rowset is:: "+crs4.size());
    JoinRowSet jrs = new JoinRowSetImpl();
    System.out.println("Adding 1st crs :: "+crs3.size());
    int [] idArray = {1,2};
    crs3.setMatchColumn(idArray);
    jrs.addRowSet(crs3);
    crs4.setMatchColumn(idArray);
    jrs.addRowSet(crs4);
         FileWriter fWriter;
    fWriter = new FileWriter("myoutput.xml");
    jrs.writeXml(fWriter);
    fWriter.flush();
    fWriter.close();

    I have no idea this is what you are trying but look at this.
    String select Statement = "select table1.project_id, table1.bld_id, table1.bld_name, table2.project_name from table1 left join table2 on table1.project_id = table2.project_id and table1.bld_id = table2.bld_id where ... order ...";
    Statement stmt8 = con.createStatement();
    ResultSet rs = stmt8.executeQuery(select Statement );The joined data is in rs.
    rykk

  • Fill multiple columns of the report at once ???

    I have been told that when coding a Report, there is some way to fill multiple columns of the report at once.
    Instead of
    select
    field1,
    field2....
    You could do
    <????> filling field 1 and 2
    My source was vague as to what kind of thing it would be that could give a value to more than one column at one time.
    Can anyone help me here? Sorry to not have any more specifics.
    Thanks, Wayne

    You can have placeholder columns and assign the output of your select statement to the place holder columns.

  • How can I reorder the columns in the Files panel in Dreamweaver CC 2014.1?

    I just upgraded to Dreamweaver CC 2014.1, and I want to change the order of the columns in the Files panel. But I can't figure out how to do this. Can anyone help?
    Thanks,
    Kim

    <I want to change the order of the columns in the Files panel>
    You can change the sorting order by file name (ascending or descending), size, type, or date modified by clicking those labels on top of Files Panel.
    Nancy O.

  • Multiple Columns in Measurement files .tdm

    I'm using a 'write to measurement file vi' to write to .tdm files, and I need multiple columns worth of data. How do I use a combo box  to toggle between different data sets? We've already used combo boxes to differentiate between different file names, but we need multiple columns of data within those files. 
    To be more specific we have different patients, and 5 tests needed for each patient. So not only do we need a combo box for each patient (which we've done) but we need a combo box with each patient to toggle between the five different tests.
    Any help would be much appreciated. 

    Hi nisimmo,
    Would it be posssible to post the current file so we can better understand the format?
    thanks
    FLash
    National Instruments
    Applications Engineer

  • Multiple columns from the same dimension table as row labels performing slowly

    (Working with SSAS tabular)
    I'm trying to figure out what the approach should be for the following scenario:
    Lets say we have a Customer table. The table has columns such as account number, department number, name, salesperson, account manager, number of customers, delivery route, etc
    A user of the model could want to see any permutation of that information as the row labels. How should that be handled?
    What we've been doing so far is that the user adds each column they want into the "ROWS" section in Excel. This works fine with smaller tables (for example, "Department" table with a "Department Code" and "Department Name",
    but on large tables this quickly chokes. I understand why this is happening, I just haven't found a better way to accomplish the same thing.
    I can add a calculated column to the model through VS, but obviously this is unsupportable and unscalable when each person needs their own permutations of the data. Can something similar be done in Excel? 
    This question seems to be what I need:
    http://social.msdn.microsoft.com/Forums/en-US/97d1157a-1402-4227-b96a-79524401ddcd/mdx-query-performance-when-selecting-multiple-attributes-from-same-dimension?forum=sqlanalysisservices
    However I can't find any information on how to add those properties (is it a multidimensional-only thing?)

    Thanks for the help. Sorry but i'm a self-taught developer, and i may be missing some basics :)
    Anyway i've done what you suggested but i get this error:
    [nQSError: 15011]The dimension table source Dimension Services.DM_D_SERVIZI_SRV has an aggregate content specification that specifies the level Product. But the source mapping contains column COD_PRODUCT with a functional dependency association on a more detailed level .
    where:
    - DM_D_SERVIZI_SRV is the physical alias for the Service Dimension (and the name of the LTS too)
    - COD_PRODUCT is the leaf of the hierarchy, the physical primary key, but it hasnt to be included in the hierarchy
    Do i have to add another level with the primary key and hide it to the users?
    I tried to solve this going to the logical tables source properties, on the tab contents, setting "logical level" to null for the hierarchy, but i don't know if this is correct.
    Thanks

  • Creation of multiple Records in the file as per multiple segments in IDOC

    Hi SapAll.
    i have got a requirement to create a multiple records in a file based on multiple segments at sending Idoc in a File To Idoc Interface.
    the Scenario  is the reciever message type is mapped with fields of 3 segments in sending IDOC.
    SEG01   1.....1(PARENT SEGMENT)
      SEG02  0...999999(CHILD SEGMENT)
      SEG03 0...9999999(CHILD SEGMENT)
    in an instance where if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 2 times PI is creating the file with 2 records in it but
    when if the SEG01 exists for one time and SEG02 exists for 2 times and Seg03 Exists for 1 time it is raising the error in message mapping where it is supposed to create 2 records in a file with empty values in the fields (mapping with seg03) segment.
    can anybody help me in this.
    regards.
    Varma

    you can create a UDF after you validate if the count match. if match you create the message if not, call de UDF.
    this UDF should receive two parameters -->Queue SEG2 and queue of SEG3.
    then you should loop by the count of SEG2. if you find a Supress Value in the queue of SEG3 add a "" to result. for example.
    for(i=0;i<=SEG2.count;i++){
    If SEG3<i>.equals(ResultList.SUPPRESS) {
           result.addValue(" ");
    }else{result.addValue(SEG3<i>);
    the result of UDF is a queue which should map to target field directly coz it has context changes
    I think that is what you are needing. if no let me know.
    RP
    Edited by: Rodrigo Alejandro Pertierra on Jun 17, 2010 11:56 AM

  • How to force multiple columns in the Details section

    Hello,
    My report has a lot of data in the Details section, but it could fit on one page if I could put it in three columns. Is there a way to do this?
    The Details section has setting: Force the new page after certain number of visible records. This would be perfect for me if instead of multiple pages I could use multiple columns.
    Thank you,
    Peter

    Thank you.
    I think I see now how to format the columns.
    Peter
    Edited by: Peter Afonin on Sep 10, 2010 2:34 PM

  • In column view, the   file item, ie .ai doenst preview?

    The preview of items are no showing. So I have to open the file in order to see
    what it is, which is very bad, b/c i work with a lot of illustrator files.

    CocoaThumbX is a separate program that you will need to download. The developer's site is here:
    http://www.stalkingwolf.net/software/cocothumbx/
    When you run the program you can select a batch of files and drop them into the program and it will create thumbnails for many, perhaps even most of the ai files, but not all. I have not checked to find out why some of thumbnails are blank. Also, the thumbnails it creates appear to be only a tiny section of the original. There may be a better program for creating ai thumbs.
    You can download the free QuickLook generator here:
    http://hrmpf.com/wordpress/195/leopard-quick-look-for-illustrator-files
    Download, unzip, and put the file here:
    "/Library/QuickLook/illust.qlgenerator"
    You'll need to restart or log out and back in. You will then be able to see a full thumbnail in the Finder in both the Preview column of a window in column view, and in Quicklook with any window view, just select the file and hit the Spacebar.
    Francine
    Francine
    Schwieder

  • Multiple columns (named the same originally) and mapped to the same lookup table are causing a Cube Build issue

    Hey folks, looking for some insight here.
    I've an implementation that contains some custom Enterprise columns mapped to lookup tables.  In the instance I'm working with now, it looks like there was/is an issue with one of those columns.  In this scenario, I have a column named
    ProjectType, created initially with that name, mapped to a lookup table.  This field's name was then changed to
    Project Type.  After that, it looks like another column was created, also called
    ProjectType.  So now, we have what I would have originally thought was two distinct columns, even though the names used are the same.
    Below is the error we're currently getting during the Cube Build Process...
    PWA:http://ps2010/PWA, ServiceApp:Project Web App, User:DOMAIN\user, PSI: SqlException occurred in DAL:  <Error><Class>1</Class><LineNumber>1</LineNumber><Number>4506</Number><Procedure>MSP_EpmProject_OlapView_B8546719-4D4C-473A-84B1-89DEDA2307E0</Procedure> 
    <Message>  System.Data.SqlClient.SqlError: Column names in each view or function must be unique. Column name 'ProjectType' in view or function 'MSP_EpmProject_OlapView_B8546719-4D4C-473A-84B1-89DEDA2307E0' is specified more than once.  </Message> 
    <CallStack>   
     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)   
     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)   
     at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)   
     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)   
     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)   
     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)   
     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)   
     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()   
     at Microsoft.Office.Project.Server.DataAccessLayer.DAL.SubDal.ExecuteStoredProcedureNoResult(String storedProcedureName, SqlParameter[] parameters)  </CallStack>  </Error>
    I've tried deleting the one column, but the build still gives the above error.
    Any thoughts as to how the above could be resolved?
    Thanks! - M
    Michael Mukalian | Jan 2010 - Dec 2010 MVP SharePoint Services | MCTS: MOSS 2007 Configuration | http://www.mukalian.com/blog

    We tried taking it out of the cubes, and it builds fine.  The challenge we're having is in building the cubes with that custom field "ProjectType".  It's as if the cubes still hold some reference to it even when it's deleted.
    Since the OLAP View ('MSP_EpmProject_OlapView_{guid}') is recreated, would it be as simple as deleting that View, and trying to recreate?
    Thanks - M
    Michael Mukalian | Jan 2010 - Dec 2010 MVP SharePoint Services | MCTS: MOSS 2007 Configuration | http://www.mukalian.com/blog

  • Can't change to multiple columns in the middle of a doc?

    Hey guys, I have a long document and I need to add some text to an area in the middle. Part of this needs to be in 3 columns, but the text above and below it in 1 column. When I highlight the text that I need to switch to 3 columns and make the change, the text above and below it changes as well. Thoughts?

    Dave
    Insert a layout break
    +Menu > Insert > Layout Break+
    Then
    +Inspector > Layout > Layout > Columns > 3+
    Afterwards insert another layout break and change it back to 1 column or whatever.
    Peter

  • Page with multiple columns in the RTF

    Hi,
    I am facing a issue while arrange the page with single and 3 columns in the RTF. I did format like Format tab->columns-> selected number of columns 3.
    The 3 columns data is showing the next page. I did not put any page break in the RTF.
    let me know what is the issue?
    I want show values like :
    Name :XXX Issued To:XXX
    dept grade dept grade dept grade
    -------------- --------------- ----------------

    Hi,
    Use @inlines in your for each clause, blog on this recently on Tim Dexter's blog.
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • Apply a function to multiple columns at the same time?!

    Hi,
    I have a table with many char columns. They have to be transformed to numbers. Right now I use an expression operator where I input all the columns and generated the output columns by typing in every column TO_NUMBER(column_xyz) which is very much work and not straight forward...
    Is there a posibility to apply the TO_NUMBER() function to all the columns in on step? If so how do I do it?
    Transform-Operator and Anydata converter don't support multiple input I already tried...
    please help, thanks in advance

    You could write a little utility in OMB scripting that would create the expression operator and apply the transformation to all columns..
    For example to set the expression on an output attribute of an expression operator you can use the following snippet;
    OMBALTER MAPPING 'MYMAP' MODIFY ATTRIBUTE 'MYEXP' OF GROUP 'OUTGRP1' OF OPERATOR 'MYEXPR' \
    SET PROPERTIES (EXPRESSION) VALUES ('TO_NUMBER(INGRP1.COLA')
    Cheers
    David

Maybe you are looking for