Java mapping - for reading the binary file contents and changing filename

Hi,
I have already gone through the various bolgs and threads and have not been able to find a solution to my problem.
One blog did give some idea but did not help- "JAAPPING", an alternate way of reading a CSV file
I am not very good in java but have been trying some out recently to fulfill the interface requirements.
I would really appreciate if you could help am I am giving below the detailed scenario below.
Part 1- working fine - The incoming file looks like:
:20:STMEMU096868DUBE
:25:001180256210
:28C:00371/00001
:60F:C090617AED742136,92
:61:0906300630CD34,27FINTCREDIT INTEREST
26MAY2009 TO 25JUN2009
:62F:C090630AED742171,19
:64:C090630AED742171,19
The file name as received is:TCDE.BLQSAM.SAEA2682.C0084025.A9G24T58.20090724195908
This file without any conversion is placed on XI server dircetory folder.
Part 2 - need to develop
The file should now be renamed according to the incoming value in 2nd line - specifically the 12 digit value 001180256210 and placed on the R/3 dircetory folder.
The new file name in the above example should be:
AC_NO_001180256210_datetime
The module for the above was created and the last time I checked it was working.
However, when I wanted to do final testing in Dev and move the changes further, the module has seemed to have stopped working so I need an alternate solution fast.
I was thinking of doing the Java mapping as I will be more in control as to what is going on thereby reducing the dependency.
There is no need to create any target xml structure as the file as it is needs to be placed in the target folder with a new name.
I can get the file name in UDF which I have already created but i am not usre if it working.
Can you please help?
Any help will be greatly appreciated.
Regards,
Archana
+44-7867636863

Hi Stephen
The xml must be getting added in the below part of the code. It is coming from arg[0]
You can put a check and get it removed.
while ((len = arg0.read(buffer)) != -1) {
  arg1.write(buffer, 0, len);
Regards
Osman

Similar Messages

  • What's the best way for reading this binary file?

    I've written a program that acquires data from a DAQmx card and writes it on a binary file (attached file and picture). The data that I'm acquiring comes from 8 channels, at 2.5MS/s for, at least, 5 seconds. What's the best way of reading this binary file, knowing that:
    -I'll need it also on graphics (only after acquiring)
    -I also need to see these values and use them later in Matlab.
    I've tried the "Array to Spreadsheet String", but LabView goes out of memory (even if I don't use all of the 8 channels, but only 1).
    LabView 8.6
    Solved!
    Go to Solution.
    Attachments:
    AcquireWrite02.vi ‏15 KB
    myvi.jpg ‏55 KB

    But my real problem, at least now, is how can I divide the information to get not only one graphic but eight?
    I can read the file, but I get this (with only two channels):
    So what I tried was, using a for loop, saving 250 elements in different arrays and then writing it to the .txt file. But it doesn't come right... I used 250 because that's what I got from the graphic: at each 250 points it plots the other channel.
    Am I missing something here? How should I treat the information coming from the binary file, if not the way I'm doing?
    (attached are the .vi files I'm using to save in the .txt format)
    (EDITED. I just saw that I was dividing my graph's data in 4 just before plotting it... so It isn't 250 but 1000 elements for each channel... Still, the problem has not been solved)
    Message Edited by Danigno on 11-17-2008 08:47 AM
    Attachments:
    mygraph.jpg ‏280 KB
    Read Binary File and Save as txt - 2 channels - with SetFilePosition.vi ‏14 KB
    Read Binary File and Save as txt - with SetFilePosition_b_save2files_with_array.vi ‏14 KB

  • How can I convert the binary file content to XML message

    Dear friends,
    I poll the binary file from a ftp server but the payload only includes the binary content, no XML structure in the payload, I hope to convert the binary content to a element node within the XML structure, how can I do that? via content conversion?
    Thanks and regards,
    Bean

    Read the binary file stream using java I/O standard functions and convert the read stream to Base64 format. Now map this content to one of the field in target XML structure.
    You need a java mapping for this.
    what is your target system?
    Thanks,
    Gujjeti.
    Hi Gujjeti,
    Thanks a lot for your kind help, my target system is R/3.
    Can I achieve that with a UDF or a simple way?
    Regards,
    Bean

  • Read incoming EDI File content and FTP file on R/3 server based on value

    Hi,
    We have the below scenario:
    The incoming file is received in XI in the below directory:
    /usr/feeders//interfaces/EP1/abc
    The file name is- TCDE.BLQSAM.OCAA2682.C0084031
    The file contains some data like below:
    UNBUNOA:3HEXAGON-ABCABC10268002090806:1004+403140015324'
    UNH1CONTRL:2:2:UN:APACS'
    UCI1000284217ABC10268002HEXAGON-ABC7+C00'
    Based on this incoming file reference number in line 3 as given (1000284217) for example, a lookup needs to be made in R/3 in a table to determine if the file should be placed in directory A or Directory B in R/3 without any XML conversion.
    I have made the scenario and the details are as below:
    Created the new Mapping Archive in the IR and import this .jar
    Created an Interface mapping for the Control File processing and select the mapping program from the archive
    Created a Business Service called  "BSY_ECC6_FI_CENTRAL" and a communication channel called "CCIA_01_RFC_RECEIVER", for the connection to the R/3 system of type RFC and will have to have the connection settings for the R/3 backend with the client which has the data in it for the FM call.
    I have the java code that I can forward you for reference.
    I am not able to run the scenario successfully.
    Plaese advise as to how I can develop this scenario.
    Regards,
    Archana

    Hi Archana,
    Based on this incoming file reference number in line 3 as given (1000284217) for example, a lookup needs to be made in R/3 in a table to determine if the file should be placed in directory A or Directory B in R/3 without any XML conversion.
    Created the new Mapping Archive in the IR and import this .jar
    Created an Interface mapping for the Control File processing and select the mapping program from the archive
    Created a Business Service called "BSY_ECC6_FI_CENTRAL" and a communication channel called "CCIA_01_RFC_RECEIVER",
    for the connection to the R/3 system of type RFC and will have to have the connection settings for the R/3 backend with the
    client which has the data in it for the FM call.
    What i understand from your Qs is, you want to get the location where the file need to be placed from the table in R/3 system
    based on the ref. no mentioned in source EDI file, and the target file should be placed as a flat file format.
    You are using RFC lookup to get the details of the location in Java mapping, Once you have the location you can map it to the
    element in payload and using varaible substitution you can specify the  target directory.
    Regards,
    Prasanna

  • Java Mapping for Flat file

    hello SDNers,
    I am using JAVA mapping for converting FlatFlie IDoc to IDoc and i am using metadata for this.While downloading metadata from SAP system, the first segment in the data record is having level 2.
    1) What is the use of Level in metadata?
    2)  What is the Level for first segment in data record of metadata. Is it Level 1 or Level 2?
    3) I am facing an error while appending the node. Is it because of Level differs?
    Plese help me out and thanks in advance

    Hi,
    >>>I am using JAVA mapping for converting FlatFlie IDoc to IDoc and i am using metadata for thi
    why do you develop is from scratch is the code is already there - just copy and paste...
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    >>>1) What is the use of Level in metadata?
    this shows how the nested segments in IDOC are to be understood
    >>>3) I am facing an error while appending the node. Is it because of Level differs?
    no, it becase your code is incorrect - the level velidation will be done at the receiver
    Regards,
    Michal Krawczyk

  • HT5878 how to check the detail of font being used for reading the file received by an email

    I received word file as an attachment with email on my iphone. I want to check the detail on font being used for reading the word file received as attachment in an email.
    Thanks

    You don't need to copy the cert out of your configuration. OpenSSL has an "s_client" subcommand which can open an SSL connection and verify the cert for you. It even knows how to do STARTTLS. Something like this ought to do it:
    openssl s_client -starttls smtp -CAfile /path/to/ca/file -connect your.ironport:25
    The /path/to/ca/file is necessary to provide openssl with a cache of root CA certs. You could use -CApath instead of -CAfile if you have a hashed directory of root CA certs instead of a single file containing them all.
    You can also point this at your partner's SMTP server as well.

  • How to read a PDF file content???

    Hi Experts,
    I need to read the pdf file content.
    Pdf file is in some repository
    I m unable to read pdf data with getContent() function.
    Please suggest me a way to read the pdf file
    Help will be appreciated and rewarded

    Hi Pankaj,
    Are you able to achieve the above said functionality? Even I too have the similar requirement.
    Can you pls let me know the solution or alternatives for your requirement you have followed...
    Thanks in advance.
    Nandu.

  • I have installed Firefox but I keep getting the following message, "Failed to read the configuration file."

    Firefox has stopped working. I have uninstalled it and reinstalled it and it still will not work. It tells me that it installed successfully but when I launch it I get a window that says, "Failed to read the configuration file." and it will not open. Please help.

    Do a clean reinstall.
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 5.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Uninstall your current Firefox version.
    * Do not remove personal data when you uninstall the current version.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    * It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/Profile_backup

  • I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I have written a binary file with a specific header format in LABVIEW 8.6 and tried  to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I can think of two possible stumbling blocks:
    What are your 8.6 options for "byte order" and "prepend array or string size"?
    Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
    LabVIEW Champion . Do more with less code and in less time .

  • I need to sort the incoming file contents before message mapping

    Hi All,
      I have requirement like i have to sort the file contents before message mapping in Xi. is there any option please suggest me with your value information.i dont want to sort in message mapping before that i want file contents to be sorted order.waiting for your quick reply.
    Thanks,
    seshagiri

    Hi,
    You can do this in one scenario.
    Lets say you have MT_Source and MT_Target as two message types.
    Now your MM1 will be between MT_Source & MT_Source, that is same message type. Here you built your sorting logic.
    Now create MM2, between MT_Source & MT_Target. Here your actual mapping logic will be implemented. The input payload for MM2 will be sorted data.
    Now in operation mapping, first call MM1 and then call MM2 (You have a plus + sign to add multiple mapping programs). Due to this sequence, at run time first MM1 will be executed and after that its oupt will be given to MM2 as source payload.
    Hope its clear. Plz let me know if you have any doubts.
    -Gouri

  • Read file content and keep binary copy

    Hi All,  I don't know what the best way of doing this is, but my requirement is to read the content of a file using File Adapter and post a document with this datda in SAP, but also to keep a binary copy of the file attached to the posted document.
    So my question is, Is there a way within the file adapter to read the content of the file using the Content Conversion mechanism and at the same type keep a binary copy of the read file.
    Thanks,
    Pablo

    Hi,
    I know we can send it via proxy but your question was something different or my be I misunderstood it.. here is your question again..
    >
    Pablo Lopez wrote:
    > Hi All,  I don't know what the best way of doing this is, but my requirement is to read the content of a file using File Adapter and post a document with this datda in SAP, but also to keep a binary copy of the file attached to the posted document.
    > So my question is, Is there a way within the file adapter to read the content of the file using the Content Conversion mechanism and at the same type keep a binary copy of the read file.
    >
    > Thanks,
    > Pablo
    What I understood from your question that, there is a file which you want to read/pick via file adapter and at the same time you also want to attach same file along with the content and then post it to R3.
    If my assumption is correct then it is not possible. Yeh If there is some workaround then that is different story.
    Regards,
    Sarvesh

  • Reading a binary file using the type cast function is not working

    Hello
    I am trying to read a binary file.  Using the Read from binary file and type cast functions I can actually get the information from the file.
    I set an indicator in the “Normal” option in Properties. I can read the header and footer but not the body of the file; For the body of the file all I can see is characters of the type
    “C¾ Ü Qþ  X@ “. One of the other options, Password, seems to provide an output of just the characters that were originally written, but then again, I can not read the characters because it is only asterisks and I can not copy them onto a word processor either.
    I tried setting the indicator in Hexadecimal mode, then creating a local variable that acts as a control and use the type cast function again to see if  could convert the Hexadecimal string to readable ASCII characters; unfortunately, this did not work either.
    I don’t know what else I should try or if there is something that I may not be doing right and for that reason I am not getting the desired results. I hope someone has an idea about this issue.
    Regards,
    Roberto

    Thank you for your reply,
    Well, actually I don’t have any information about this file. I will try to obtain information about it though.
    This is a file that contains velocity information; there are 65 channels that form a velocity profile in a pipe. Also, there are 4096 velocity profiles. I don’t know what is the format of these values.
    The software that creates the file provides a text file. Using this text file the velocity information can be processed and then plotted.
    I want to avoid all these intermediate steps and read, process and plot everything using only LabView. BTW, I am using LabView 8.2
    Roberto

  • Hi im having huge problems trying to install flash for my mac 10.5 imac, iv gone through the internet and tried all of the solutions, everytime i try to install flash it says cant read the download file, or it just wont install, anybody plz help!

    hi im having huge problems trying to install flash for my mac 10.5 imac, iv gone through the internet and tried all of the solutions, everytime i try to install flash it says cant read the download file, or it just wont install, anybody plz help!
    iv unistalled flash, iv checked plug ins it just wont work,

    It would have been a great help to know precisely what Mac you have, so some of the following may not apply:
    You can check here:  http://www.adobe.com/products/flash/about/  to see which version you should install for your Mac and OS. Note that version 10,1,102,64 is the last version available to PPC Mac users*. The latest version,10.3.183.23 or later, is for Intel Macs only running Tiger or Leopard, as Adobe no longer support the PPC platform. Version 11.4.402.265 or later is for Snow Leopard onwards.
    (If you are running Mavericks: After years of fighting malware and exploits facilitated through Adobe's Flash Player, the company is taking advantage of Apple's new App Sandbox feature to restrict malicious code from running outside of Safari in OS X Mavericks.)
    * Unhelpfully, if you want the last version for PPC (G4 or G5) Macs, you need to go here:  http://kb2.adobe.com/cps/142/tn_14266.html  and scroll down to 'Archived Versions/Older Archives'. Flash Player 10.1.102.64 is the one you download. More information here:  http://kb2.adobe.com/cps/838/cpsid_83808.html
    You should first uninstall any previous version of Flash Player, using the uninstaller from here (make sure you use the correct one!):
    http://kb2.adobe.com/cps/909/cpsid_90906.html
    and also that you follow the instructions closely, such as closing ALL applications (including Safari) first before installing. You must also carry out a permission repair after installing anything from Adobe.
    After installing, reboot your Mac and relaunch Safari, then in Safari Preferences/Security enable ‘Allow Plugins’. If you are running 10.6.8 or later:
    When you have installed the latest version of Flash, relaunch Safari and test.
    If you're getting a "blocked plug-in" error, then in System Preferences… ▹ Flash Player ▹ Advanced
    click Check Now. Quit and relaunch your browser.
    You can also try these illustrated instructions from C F McBlob to perform a full "clean install", which will resolve the "Blocked Plug-in" message when trying to update via the GUI updater from Adobe.
    Use the FULL installer for 12.0.0.44:  Flash Player 12 (Mac OS X)
    And the instructons are here: Snow Leopard Clean Install.pdf
    (If you are running a PPC Mac with Flash Player 10.1.102.64 and are having problems with watching videos on FaceBook or other sites, try the following solution which fools the site into thinking that you are running the version 11.5.502.55:)
    Download this http://scriptogr.am/nordkril/post/adobe-flash-11.5-for-powerpc to your desktop, unzip it, and replace the current Flash Player plug-in which is in your main/Library/Internet Plug-Ins folder, (not the user Library). Save the old one just in case this one doesn't work.

  • Is there any way to read the pdf file in java

    Hai,
    i need some advice from anyone that is there anyway to read the pdf file directly from java...
    Without converting to other files(txt,html)
    if it is possible please help me..
    Thank you

    Or use the Adobe one (search the adobe site). Or search this forum, this is one of the Top Ten Qestions Asked here.

  • Elements 7 on windows 7, have downloaded a new version on raw for my new camera eos50d still unable to read the raw files help

    Hi
    Hope someone can help me with this one, have a new computer with windows 7 as the operating system, have installed elements 7 and have now purchased the 50d, as i shoot in raw have tried to open the file but elements is unable to read the raw file, have looked on various threads and have downloaded the new version of raw, this version is saved in my download file directory, have copied across these files to the elements folder but i still cannot read my raw file for the 50d, is there something i have missed.
    collisa

    please have a look at the folllowing link about the isntallation of the camera raw plugin.
    http://kb2.adobe.com/cps/407/kb407344.html
    be sure not to have the older version of camera raw plugin in the same folder as that of new one. dont even rename it. Remove it and store it in some other location in case you need to revert back the changes. The camera raw plugin is called : Camera Raw
    thanks

Maybe you are looking for