Reading and Translating

Hello.
I have a file which contains several lines in it.
What I'd like to do with it is to read it line by line and see if the line has a particular character in it. (for example, I'd like to find character "&" and replace it with "and" ) After examining every lines, i want to save the file in different name.
For this, I think I have to examine character by character(but im not sure how to do it).
Does anyone have some idea of how to examine characters for several lines?
Thanks for reading

Here is the method I use to translate...this method is called
public void translateFile(){
try {
fr = new FileReader (inputFile);
out = new FileWriter (outputFile);
catch (IOException e) {
System.err.println (e);
return;
try {
br = new BufferedReader (fr);
output = new PrintWriter (out);
int lineNumber= 1;
while ((line = br.readLine()) != null) {
examine(line); //each line is passed through this method
output.println(line);
lineNumber++;
output.close();
catch (IOException e) {
System.err.println (line);
System.err.println (e);
//method to examine each char
public String examine(String s){
char c;
char a ='&';
//how can I examine each like if it contains a character '&' and replace it to "and" , and put "and" into output???
return line;
}

Similar Messages

  • I have a PDF with a diagram, I need to translate the text so I open it in Illustrator.  The document opnes up vertically oriented  I try to put it horizontal to be able to read and change the text  However everything I have done is not working  The artboa

    I have a PDF with a diagram, I need to translate the text so I open it in Illustrator.  The document opens up vertically oriented  I try to put it horizontal to be able to read and change the text  However everything I have done is not working  The artboard does change, but the diagram stays vertical.....Please help  I need to finish that for today..Please help

    A PDF usually consists of one to an indefinite number of clipping masks inside each other.
    You need to be very carefull with selecting stuff.
    So you need to read the manual on how to select stuff and on the basics of Illustrator.
    On top of that: because of the complex hierarchy of PDF files, it is kind of difficult to help you without seeing anything.

  • Modbus Ethernet read and write to a Eurotherm 6180XIO Modbus server using LV8.2 shared variables

    I am having EXTREME difficulty trying to establish communications with a Modbus device using LV8.2 shared variables.  The device is a Eurotherm 6180XIO Datalogger configured as a Modbus master.  The PC and a cFP-1804 are slaves.  All IP addresses are set correctly.  This approach using shared variables would seem simple, but I can't find any examples or proper guidance on how to get it working.  I am trying to avoid having to mess around with TCP/IP, OPC, or any other old-fashioned method.
    I have read many threads on related topics but none directly apply to this situation.  I have created a library containing a Modbus I/O server and shared variables bound to read and write holding registers.  I have followed all recommended tips for creating such variables but I can neither read or write data.  All data types are U16 due to Modbus protocol limitations.  I have also applied the LV x10 factor in the most significant digit in the register offset (6 digits instead of 5).
    I have a cFP-1804 on the same network which reads into the datalogger OK.  The registers I use are 31000 (for CH0 on module 0, 31002 for CH1, etc) and the data can be read as FLOAT32.  I have updated the firmwate on the 1804 to the latest level.  I cannot even get shared variables to read SGL values.  Using registers 301001 for CH0 and 301002 for CH1 I can only read U16 values, and not a 2-word SGL.
    Third party Modbus simulation software is able to write to and read from registers very easily, but not LabVIEW.
    Some questions are:
    - do I use a Modbus master or slave as an I/O server in the library as a target for binding the shared variables?
    - is there some other wierd translation in register offsets between LabVIEW and traditional Modbus?
    - is this actually possible using shared variables or am I wasting my time?

    Sending the whole 60-character string using a string or array would be the most efficient.  I have tried both methods, and these only cause the datalogger to flag a message log but no text is displayed.
    For a string variable, I have used the following binding "My Computer\Modbus Test.lvlib\ModbusServer6180\442305", where ModbusServer6180 is a Modbus I/O server configured with the logger IP address, and 42304 is the register offset at the start of the text block in the logger.  I need to write to 30 consecutive registers starting with this one.  I am not using buffering and have not enabled single writer.
    Can anyone confirm whether this method should work in 8.2?
    Does the string need a special termination character?

  • What Floppy Drive can I use with Mountain Lion to read and write floppy which can be read by SE30 with 7.1

    I want to File Exchange between an iMac with 10.8.4 and a SE30 with 7.1.
    All I want to do is install some software, such as Word 5.1 and a Chess game and some Fonts.
    I have an external USB Floppy Drive but my iMac can only write to it IF I format as FAT, if I format it with the SE30 it can only be read and not written onto by the iMac.
    Is there a way I can actually format/read/write Macintosh extended (HFS+) with Mountain Lion?
    The external USB Floppy is a generic black one I bought from Amazon last week.
    Someone else said I should get a Macally USB Floppy Drive and that reads/writes HFS+ etc with 10.8 no problem.
    Is this because the Macally was released along with the Bondi Blue iMac?
    I have tried using Apple Exchange on my SE30 - recorded some files onto the FAT formatted Floppy, and read it using Apple Exchange, but when 'translating' the Files transferred over as generic files which were no longer Macintosh programs or Files (eg Word 5.1 application or extensions/ Font suitcases etc) and could not be read.
    Is there a way round this?
    Or is there any way I can mount/read/write from the generic USB Floppy DRIVE with Sheepshaver (with 7.5.3)?
    Any help or advice would be most appreciated.

    >surely there must be some Terminal command or workaround for 10.8 to be able to Format in HFS?
    Using dd to write an existing HFS disk image to a floppy may still work (but formatting/writing HFS from the operating system does not). You may want to compare this with the technique described in the article below. Obviously, this is only of interest if one wants to try creating floppies from certain (Disk Copy 4.2-style) downloaded 1.44 MB disk images.
    http://lowendmac.com/brierley/08pb/classic-mac-boot-floppy.html
    >If I got hold of an old iBook or Powerbook G4 (my sister has one) could I plug the USB Floppy drive I have into one of these and copy files over this way?
    At least according to the following Wikipedia article, writing HFS has not been supported since Mac OS X 10.6. This should mean that your idea with the USB floppy drive connected to one of the older computers mentioned could work. BTW, I do not think that the USB floppy drive type/make/model is of importance in this very context.
    Another idea could possibly be to use an even older intermediate computer for other file transfer methods (without a floppy).
    A PowerBook 520/520c/540/540c could run Mac OS 8.1, if at all necessary. It has built-in Ethernet (an external AAUI to RJ-45 transceiver is used), which would allow TCP/IP connections over a network. A LocalTalk connection to the SE/30 can be established via a plain Macintosh MiniDIN-8M to MiniDIN-8M printer cable. With the correct SCSI cable/adapter, one could also use the PowerBook as an external hard disk for the SE/30 in SCSI disk mode.
    A PowerBook 5300 can run Mac OS 8.1 or higher, if necessary. It does not have built-in Ethernet, but a PC Card (PCMCIA) network card can be used. Furthermore, with an inexpensive PC Card adapter for CompactFlash and a CompactFlash memory card, the computer would have a simple removable "hard disk". The CF card (in Mac or PC format) can be read by a modern computer (a USB reader may be needed), making it ideal for file transfers. LocalTalk can be used here too, and so can SCSI disk mode (HD target mode).
    Jan

  • Object reading and writing

    i have to read a very large files that consist of header(5000 bytes)main file(10,000 bytes), footer(4000 bytes) this is a binary file.The current code is in c++, the logic implemented is like as:- there are three classes and the data structure defined for these classes for these three classes is same as the information stored in binary.Header data structure is 5000 bytes footer is 4000 bytes and then main.So when ever the large file is read the process invokes read method and pass the object of header and a pointer for reading 5000 bytes.As structure is same all the values read are assigned accordingly to header in single shot.Here is example
    class header
    char name array[2000];
    char Address array[2000];
    in reaqd methods i pass object of header. binary file name and a pointer to read first 4000 bytes
    so it aitoamtically assign first 2000 to name rest to address
    same funtionality i have to do in java.I am not able to do it.
    is it posilbe ot i have to read byte array and then fire setmethods for each data to do this or can i simulate this c++ funtionality in java .
    pl help

    there are
    three classes and the data structure defined for these
    classes for these three classes is same as the
    information stored in binary.So, if I understand what you want to do, you need to read C++ binary data into a Java class, but don't want to go through the process of translating that data and calling individual getters and setters?
    First thing: be aware that the byte order of C++ data will differ, depending on the machine that wrote the file. If you're reading files from different machines, you may not get back what you expect (which is one reason that XML exists, to store everything in text rather than binary).
    Second: do you have a Java class that exactly mimics the C++ class? You need to be aware of field size and type (eg, a 16-bit C++ int corresponds to a Java short), and recognize that the same types may have different sizes depending on the C++ implementation.
    If you have considered these two points, then look at java.lang.reflect.
    1) Define a static array containing the names of the fields in your object, in the order they appear in the data. This is necessary because Class.getFields() does not guarantee order of the fields returned.
    2) Call getClass() on the passed object.
    3) For every field in your list from step 1, call getField() on the Class object that you got from step 2.
    4) Read the appropriate amount of data from the file (see below), and use the appropriate set method on the Field object that you got in step 3.
    How do you know how much data to read from the file? There are a couple of ways to do this. You can use the getType() method on the Field object (from step 3), then use this to find an appropriate "read and convert" routine. Or, if you want to drive from the C++ code, the table that you define in step 1 could identify the C++ type.
    This is, of course, only a skeleton description of what you need to do. But as outlined, it should take only a day or two to implement. The real problem is if your C++ structures change frequently, or you'll be processing data from multiple sources (so byte order and field size may change). In that case, you may (1) find it best to implement a parser to build your field table, and (2) drive everything off the field table, which would then have to contain additional information about the appropriate conversion routine.
    Also, you could check SourceForge or other open-source sites, to see if someone has already done this.

  • Need explanation on prerouting post routing and translation rouitng with examples

    Hi ,
    i need explanation on prerouting post routing and translation rouitng  with examples.can anybody help me out ?
    thanks in advance
    regards
    bala

    Hi,
    prereouting: call comes in, hits ICM, script is run, telling the routing client (PSTN) where to route the call to (so the call is routed before (pre-) connection, or rather, establishment).
    Postrouting: call comes in, is connected and then it hits ICM (so the call is routed after begin connected).
    Translation routing is an interesting hybrid: call comes in, is connected but the party the call is connected to, is being monitored by ICM (so it sends the call away but it keeps an eye on it). When it's necessary, call is transferred to a different destination.
    Examples:
    Prerouting: PSTN -> ICM (script) -> PSTN -> destination phone answers
    Postrouting: PSTN -> call is answered -> ICM -> transfer to destination phone, answered
    Translation routing: PSTN -> call is answered -> ICM transfers to IVR port, then transfers to final destination phone (agent).
    G.

  • H.D "Store TV Toshiba 500G" cannot read Arabic translation

    Dear team
    I have problem with my H.D "Store TV Toshiba 500G" its not support to read Arabic text translate on Films
    Is there any steps to can be read Arabic translate?
    Appreciate your help and support
    Regards

    Im afraid there is nothing you can do.
    If I am remembering well few weeks ago one guy posted here with same problem using Cyrillic film translation.

  • Due to my laptop screen failing i have to return to facory settings, can i reinstall adobe reader and adobe air afterwards?

    Due to my laptop screen failing I have to return it to factory settings, can I reinstall adobe reader and air afterwards?

    I don't see why not. Do you foresee a special difficulty?

  • In iCal and Notifications on a notebook, is it possible to expand the notes window to make it easier to read and write notes?

    In iCal and Notifications on a notebook, is it possible to expand the notes window to make it easier to read and write notes? In the past, I have used Outlook calendar and tasks and I was able to expand the windows which allowed me to put a great amount of details into either the notes section in events and tasks. It would be great to be able to do this in iCal and Notifications as well. I am using a Macbook Pro with OS X 10.8. Thank you very much for assistance with this.

    HI,
    Try Spaces for a virtual desktop.
    http://www.ehow.com/how2189851use-spaces-mac-os-x.html
    Carolyn

  • Reader and Windows 8.1 FULL SCREEN?

    Is there a way to view a document in Reader and Windows 8.1 other than on FULL SCREEN.  In previous versions, I could look at a.pdf file while working on another file on my computer screen.  This allowed me to get info from the .pdf file and input into the other program.

    It might  be that you're viewing with an app written to Microsoft's new and exciting "modern" interface which is always full screen. Apparently it's much better and more exciting.
    Microsoft Reader comes with Windows 8 and runs that way. Adobe also offer "Adobe Reader Touch" which runs that way.
    Some of us old dinosaurs who think it might be neat to arrange multiple apps so we can do more than one thing at once like to run the "legacy" apps like Adobe Reader.

  • I have an external hard drive, from Iomega. However, I cannot copy or save any file to it. On my PC it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?

    I have an external hard drive, from Iomega. that I can open and see my files. However, I cannot copy or save any file to it. On my PC I have it says that is possible to read and write in it, but in my Mac, it says I can only read. can somebody help me?
    Also, Im a photographer, so I like to name a lot of files at the same time (used to do in on PC and it was very usefull.) cannot find out how to do it on my Mac. Really appretiate if some one can give me a solution! Thanx

    Your drive is formatted with the NTFS file system.  OS X can read but not write to the NTFS file system.  There are third party drivers available that claim to add the ability to OS X to write to an NTFS partition.  I have not tried them and don't know if they work.
    The only file system that OS X and Windows can both write to natively is the FAT32 file system.

  • Problems with Adobe Reader and Flash Player

    I had an Adobe update last Monday and, ever since then, I can't view documents (eg credit card statements) on screen and sites that I previously visited regularly without problem suddenly say that I need to have Adobe Flash Player installed. I've downloaded Adobe Flash Player and it says it's installed correctly but when I return to the site, it still says I need Adobe Flash Player. I've also tried doing an uninstall first and then an instal but the same thing happens. I've run disk first aid and it found a problem with the Head which it fixed but I still can't open documents using Adobe in Safari. Adobe Plug ins tells me that the Internet Access plug in is not loaded but when I ran 'repair Adobe Reader installation", it said there were no missing components detected and repair was not needed. I don't know if it's relevant but I've been having problems with Safari for several weeks, quitting 3 or 4 times a day, mainly when I'm switching from Safari to another programme such as Entourage or Excel.
    Message was edited by: Aileen2

    Hi Carolyn
    I don't think I made it clear on the original post that I'm having problems with both Adobe Reader AND Adobe Flash Player. Unfortunately, all the Adobe Reader sites are confidential so I can't give you an illustration on that but for the Adobe Flash Player, try www.jacquielawson.com/ - you can preview cards without being signed in. With the Adobe Reader problems, I get a picture of a blank 'piece of paper' with a small blue square in the top right hand corner that has a white question mark inside it. The first time this happened to me, I was on the UK Inland Revenue site trying to print out some end of year forms. I phoned the Revenue's helpline and they said to try doing a 'save as' to my desktop. It seemed bizarre - saving a blank piece of paper - but lo and behold, when I opened it on my desktop, the forms appeared exactly as normal. However, I've since tried this 'save as' technique with my credit card statement and I still get a blank piece of paper with a blue square and white question mark when I open the desktop copy.
    Thanks for your help and patience. I really appreciate it.
    Aileen

  • How do I get an edited pdf out of Adobe reader and into my dropbox so I can access it later?

    I have an ipad mini that I use to read journal articles.  I open them in Adobe Reader and use the tool to edit them (highlight, underline, comment, etc).  Once Ihave finished editing them how do I export them back to drop dropbox so that I can use them later on my laptop?

    Open the document in the Adobe reader app.
    Tap on the document to display the tool bar (if it is no already open.
    Tap on the Open  In icon (upper right - looks like a box with an arrow)
    Select Open In...
    Select DropBox (depending on the number of app you have available for this function, you may have to swipe to find it
    Drop Box should open with a Save to Dropbox window.
    Tap save
    You Adobe Reader app should have come with a user guide as one of the preloaded documents. It should have instruction for this as well

  • Can't view pdf; getting message to launch Adobe Reader and sign user agreement that I can't find.

    I'm trying to view my son's 1098-T on his college's website, but keep getting the message "Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser."
    When I launch Adobe Reader, I can't find a user agreement to accept.  I have tried relaunching both Google Chrome and Adobe Reader several times to no avail. I've also redownloaded and tried to reinstall Adobe Reader, but it got a message it was already installed. I previously had problems getting the pdf to fill (the form was blank and didn't have my student's info), and reinstalled Adobe Reader before I realized I had to disable Google Chrome's pdf  viewer, which I have since done.

    Sorry. I have a Mac with OS X 10.9.5
    I've since totally deleted Adobe Reader and reinstalled it but have the same problem anytime I try to view a PDF with Adobe Reader.  The college website won't let me save the form, only view it.  If I use another pdf viewer the form won't fill with my son's info; I think it has to be Adobe Reader for some reason

  • Help with opening Adobe Reader and downloading updates

    I can not open Adobe .pdf files any longer (this started yesterday, prior to that I could open adobe files).
    When I double click a .pdf file I get this notice on my screen: Windows cannot access the specified device path or file. You may not have the appropriate permission to access file.
    So I went to the Adobe download site to download a new copy of Adobe.  When I start the download I get this on the screen:  The instruction at "0x0e3a0068" referenced memory at "0x0e3a0068."  The memory could not be written.  Then two options are listed: click OK to terminate or cancel to debug.  So I click on cancel and I get this on my screen: Internet Explorer has closed this webpage to help protect your computer.   A malfunctioning or malicious addon has caused I.E. to close this webpage.
    I don't have AVG running, I do have avast but I've disabled it.  I ran Registry Mechanic and an I.E. erasure program but nothing helps.
    I have gone into I.E. and reduced the security level to its lowest state but no joy.
    So, any ideas or suggestions on what's the problem and how to overcome it would be appreciated.  Thanks, in advance, for your reply.  Jim R.

    Hi Mike..tried that as well but no joy.  A friend of mine was looking at it all and noticed that it was an I.E. thing as far as not letting me redownload the reader so I went to Mozilla Firefox and I could download a new version but....whenever I attempt to open a .pdf file I get that message, "Windows can not open the specified device, path or file. You man not have the appropriate permissions to access the item." 
    Damn...this is irritating as I need to get to some of thos files as I need them for a Journal I'm working on as editor-in-chief. 
    It all worked just fine last Saturday but starting Monday when I was on my flight out to D.C.  no joy. 
    Sigh...Jim R.
    Jim R.
    Date: Tue, 1 Dec 2009 14:50:27 -0700
    From: [email protected]
    To: [email protected]
    Subject: Help with opening Adobe Reader and downloading updates
    Under the help menu, there is an option to repair the installation of reader. Did you try that?
    >

Maybe you are looking for

  • Update Parked Non PO invoice - FBV2 functionality via BAPI or FM not BDC

    Good day all, after searching many days, I have found many threads similar to this request but none have been properly answers.  My scenario: I need to change a header field (ZUONR) and account assignment related fields (KOSTL, AUFNR, etc) in the doc

  • Down payment request scenario

    in my down payment request scenario system generate down payment request with reference to sales order. following is the procedure. 10. PR00 20. MWST 30. Value include sales tax 40. AZWR                 10-30           Reqt 2, CalTy 48 lets assume at

  • Profit center line item Display

    Dear SAP Guru,   When i post advance payment to vendor ,  in this case in g/l line item advance payment g/l show the Profit center , but when i check in t.code : KE5Z ( Profit center actual line item )  thr. advance payment g/l a/c does not diaply as

  • Clearing of reservations -reg

    Friends , issue is like this a component has been deleted from BOM, its CS15 is nothing , its not used any BOMs Still PRs are getting generated in MRP for that part number when analysed its understood that there are few Production Orders which are pa

  • To export system language to a browser using CALL_BROWSER

    Hello Experts, I am triggering a search help exit with the search help in my R\3 system, which indirectly takes me to the netweaver system via RFC. In the Netweaver function module I have used the call_browser FM to call a browser. While defining the