Results 1 to 2 of 2
  1. #1
    deepakts is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default Need python for converting data format

    XML Code:
    <pre>
    Hi All
    The below is the exisitng data in a file running over 24768 lines
    
    there are dublicate names linke (abc) , width and FLof which stands for offset
    
    
            file A
    ------------------
    ###########################################################################
    # F      Name    Gro  Width   FLof Class
    ###########################################################################
    1cbb     abc      -    6       2  INDIRECT
    1cbc     xyz      -    3       0  INDIRECT
    1cbd     abc      -    4       0  INDIRECT
    1cf3     bcd      -    3       5  INDIRECT
    1cf4     pqr      -    3       0  INDIRECT
    1cf5     bcd      -    8       0  INDIRECT
    ---------
    ---------- so on
    
    
    I want a script to convert the file data to as folowing data :
    
          file B
    -----------------
    ###########################################################################
    # F      Name           Gro  Width   FLof Class
    ###########################################################################
    1cbb     abc_7_2         -    6       2  INDIRECT
    1cbc     xyz             -    3       0  INDIRECT
    1cbd     abc_11_8        -    4       0  INDIRECT
    1cf3     bcd_7_5         -    3       5  INDIRECT
    1cf4     pqr             -    3       0  INDIRECT
    1cf5     bcd_15_8        -    8       0  INDIRECT
    
    
    Explaination for conversion is here
    first row abc has width as 6 and FLof as 2 in file A, so it occupies position  2,3,4,5,6,7 accounting to 6 position so represented as abc_7_2 in file B
    Now row three of file A has duplicate of abc so now the new offset will be previous offset plus one ie. position will start from 8 and it goes as follows 8,9,10,11 so represented as abc_11_8
    this wil create unique and informative names
    the same goes with other rows
    
    Can any one get me java program for this
    
    
    please help
    thanks in Advance
    Deepak
    </pre>

  2. #2
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,010
    Rep Power
    6

    Default Re: Need python for converting data format

    "Can any one get me java program for this"

    Yes, but nobody is going to actually do you work for you.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Problems with converting Python to JavaScript
    By mariabutenka in forum New To Java
    Replies: 1
    Last Post: 03-16-2014, 02:48 AM
  2. Converting JPEG to binary (1 and 0) format
    By alucardris in forum New To Java
    Replies: 3
    Last Post: 11-02-2013, 05:06 PM
  3. Converting JSP Page to PDF Format
    By chandrakishore5 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-16-2012, 02:19 PM
  4. Converting date to SQL format
    By UnfairBear in forum JavaServer Pages (JSP) and JSTL
    Replies: 11
    Last Post: 08-05-2011, 07:00 PM
  5. Converting ASCII format
    By right2001 in forum New To Java
    Replies: 7
    Last Post: 02-17-2009, 03:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •