Need help on how to add a delimeter into a text file

Actually, this program reads a textfile. After reading, i need to put certain delimeters after certain characters and print them out to a new file.
this is how it works :
for example...
471117-01-5179052004 VENUE SECURITIES SDN. BHD.
This is wat the programs read. Now i have to put a semicolon after this numbers ..
471117-01-5179052004 (;)
then put another semiclon after this words
VENUE SECURITIES SDN. BHD.(;)
But, this text file contains around 2000 lines, and i have to do this for each line...thts y i dunt understand how to code it.

thanks mr. micheal dunn. Anyway, how can i put this code to read from a text file.....because i need to read the whole text line and put semicolons. i cant use stringbuffer as it only reads a certain length of string..could u tell me how to do this.
this line is actaully a short line from the text file.
String str = "471117-01-5179052004 VENUE SECURITIES SDN. BHD.";
need to put the semicolon is this line actually :
471117-01-5179052004(;)AVENUE SECURITIES SDN.BHD. (;)000350785A (;)RAHMAN BIN KADIRAN 51, TAMAN MUHIBBAH SUNGAI MATI MUAR 84400(;)JMY(;)SMYSBI (;) 8516 000000030000004600 (;)1581800 ...can u explain wat is tht \\d+-..sorry im a beginner here...hope u can help me out..

Similar Messages

  • How to add header and fooder in text file

    Hi,
    i have created simple application for generate report from database into text file.
    But i need to add header and fooder in text file. I dont know is there any API for adding these.
    Can anyone help me to create header and fooder in text file.
    the below text are needs to be print in the header
    name of the table :
    Recorder type :
    file creation time:
    the below text are needs to be print in the footer
    Recorder Number:
    Record Type;
    the actual code is
                           pst = con.prepareStatement("select REQUEST, DOMAIN_NAME, TRUNC(DATE_OF_CONFIGURATION) AS dateofConfig  FROM employee where id=300");
                               rs = pst.executeQuery();
                            while (rs.next()) {
                                 request = rs.getString("REQUEST");
                                    domain_name = rs.getString("DOMAIN_NAME");
                                    dateofconfig = rs.getString("dateofConfig");
                                    System.out.println(request + " " + domain_name + " " + dateofconfig);
                                   data.add(request + " " + domain_name + " " + dateofconfig);
                            System.out.println("before calling method");
                            writeToFile(data, "c:/Employee.txt");
                            System.out.println("file created successfull");
                            rs.close();
                            pst.close();
           private static void writeToFile(List list, String path) {
                    BufferedWriter out = null;
                    try {
                            File file = new File(path);
                            out = new BufferedWriter(new FileWriter(file, true));
                            for (Object obj : list) {
                                String s=  obj.toString(); 
                                 out.write(s);
                                    out.newLine();
                            out.close();
                    } catch (IOException e) {
    }Thanks
    Jasmin
    Edited by: user13836688 on Mar 21, 2011 4:06 AM
    Edited by: user13836688 on Mar 21, 2011 4:07 AM
    Edited by: user13836688 on Mar 21, 2011 4:08 AM

    user13836688 wrote:
    i have created simple application for generate report from database into text file.First off, when posting code, use &#91;code]...&#91;/code]. or '' tags, not '<code>'.
    But i need to add header and fooder in text file. I dont know is there any API for adding these.
    Can anyone help me to create header and fooder in text file.Well you plainly have the code to write the file contents; and furthermore your report seems to be contained in a List called 'data'. Why not just add the header and footer lines to it? I'd also suggest making 'data' a LinkedList. That way you can add the header afterwards with no performance hit, just in case the information it contains isn't available at the start of your report loop.
    Winston                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to add a directory into a jar file

    Hi, guys, I want to add a package into a jar file. For example, my dirctory structrue
    is org/test/, all files locate in the directory test, in org.test package. I want to
    add the package into a jar file, test.jar. I use "java -cvf test.jar -C org/test/ .
    But it says "jar: no match". How can I solve it.
    thanks

    Instead of 'java', use 'jar'.
    All in all, try this: jar cvf test.jar -C org/test/*.class.
    Have a nice day!

  • How to write the resultset into a text file

    how to write the resultset into a text file

    You can use the java.io.* package to write to files.
    API: http://java.sun.com/j2se/1.5.0/docs/api/java/io/package-summary.html
    Tutorial: http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • Need help for how to putting arabic content in java properties file

    Hi all,
    we have to support arabic in Java application.
    For that we are using java propeties file where key and value pair is used.
    In the Microsoft excel sheet arabic content is coming properly from right to left direction.
    When same thing is copied and paste in java properties file contents direction is reversed that is it is coming from left to right as in english.
    Please help how to put the arabic contents in propeties file
    Regards
    Vidya

    So in terms discussion.
    First I would suggest that you get a hex editor and validate exactly what is in the properties file. It appears to me that you are using one or more editors that are adjusting the display for you and thus that makes it hard to determine where the problem is. A hex editor should not adjust the display. Although even then you might want to right a simple java app and have it read bytes and print them just to validate that the hex editor isn't doing something.
    Only after you are exactly sure how the bytes appear in the file then proceed with other steps.
    For the java GUI only test the following.
    1. Properties file has it left to right then the java GUI displays it correctly right to left or not?
    2. Properties file has it right to left then the java GUI displays it correctly right to left or not?
    Myself I would expect that 2 should be the correct way to implement this. However that is dependent upon you correctly invoking the api as well. So if 2 is not working then you might want to look at the api. It might also have something to do with GUI display properties (of which I know even less.)

  • How to add my class into rt.jar file?

    Hi, everyone!
    I am using WinRAR to extract the package rt.jar and added
    my class file to javax folder. Then I use jar c0vf to create
    a package. After that, I restart my WSAD4.0.2. But it seems
    that WSAD4.0.2 can not be started. (It stops at the welcome
    screen for a long time.)
    Anything wrong I have made? How to resolved the reouble?
    Cheers,
    George Ma

    Thanks!
    Do you know how to add .class file to a project of WSAD4.0.2?
    I use CLASSPATH, but always failed in IDE. But it works in
    command line environment. I want to use some classes in a
    .class file.
    Can you help?
    Cheers,
    George

  • Need Help! How to add Chapter Markers to Mix for CD?

    Help would be appreciated! So I created several mixes and I'm wondering how I can export them on one track to a CD with markers in it too skip through the song? So far all I can think of is adding chapter markers in podcast, but idk if that would export to a CD. Help Please!!!

    I take it you want to export to a CD - CDs don't have chapter markers, just separate tracks, and that's what happens if you burn a CD straight from GB.
    If you want an audio file with chapter markers, make sure you export your podcast as an AAC file. That will create an "enhanced" podcast with chapter markers, but if you burn that onto a CD, it won't play in an ordinary CD player.

  • How to save changes back into binary text file

    I have a repository with a single binary field that contains an HTML file
    I have a pageflow with a form where users can edit content, including the contents of the HTML file.
    Can I just treat that like any other property:
    If the name of my binary field containing an HTML file is “file”
    Can I just treat it like any other field in the repository and do :
    <pre>
    try{
    properties = node.getProperties();
    properties[0] = new Property("title",new Value(form.title));
    properties[1] = new Property("description",new Value(form.description));
    properties[2] = new Property("file",new Value(form.contentText));
    properties[3] = new Property("author",new Value(form.author));
    node.setProperties(properties);
    String title = form.title;
    nodeId = node.getId();
    title = node.getProperty("title").getValue().toString();
    } catch(Exception e){
    e.printStackTrace();
    error = "error1";
    RepositoryManager manager = null;
    try{
    manager = RepositoryManagerFactory.connect();
    NodeOps nodeOps = manager.getNodeOps();
    nodeOps.updateProperties(nodeId, properties);
    } catch(Exception e){
    error += "error2";
    e.printStackTrace();
    </pre>
    Thanks much.

    I have a repository with a single binary field that contains an HTML file
    I have a pageflow with a form where users can edit content, including the contents of the HTML file.
    Can I just treat that like any other property:
    If the name of my binary field containing an HTML file is “file”
    Can I just treat it like any other field in the repository and do :
    <pre>
    try{
    properties = node.getProperties();
    properties[0] = new Property("title",new Value(form.title));
    properties[1] = new Property("description",new Value(form.description));
    properties[2] = new Property("file",new Value(form.contentText));
    properties[3] = new Property("author",new Value(form.author));
    node.setProperties(properties);
    String title = form.title;
    nodeId = node.getId();
    title = node.getProperty("title").getValue().toString();
    } catch(Exception e){
    e.printStackTrace();
    error = "error1";
    RepositoryManager manager = null;
    try{
    manager = RepositoryManagerFactory.connect();
    NodeOps nodeOps = manager.getNodeOps();
    nodeOps.updateProperties(nodeId, properties);
    } catch(Exception e){
    error += "error2";
    e.printStackTrace();
    </pre>
    Thanks much.

  • I need help understanding how the Apple components integrate to create a system across all my devices?

    I need help understanding how the Apple components connect to create a whole system across all my devices?
    Is there a resource that describes current system and associated functionality?
    For example:
    Buy A, B, C to achieve "X" 
    You will need:
    an internet provider which supports <specs>
    add D to achieve "Y"
    You will need:
    an internet provider which supports <specs>
    add "E" to achieve "Z"
    You will need:
    an internet provider which supports <specs>
    For example, I am looking at the Gen 6 Airport extreme.  For intended performance do I need broadband? if so what are the specs, or will basic internet service suffice?  Do I need the internet provider's modem or does the Airport extreme replace that?  And then I think, if I am doing this, I should also look at Apple TV....What do I need and Why?  Then I look at the New Desk top coming out in the fall, and I think well, if I wait and get this, what does this component do for the system, and what becomes redundant? What does this awesome desktop do for my ability to sit and use a new macbook air when I travel  or sit on the couch in my PJs?
    If there was a place that plainly stated "if you buy the new dektop you can configure a system including only these components and achieve <this result> and by adding <additional components> you will achieve this result.
    I have been to the genius store a few times, but I come out of there more confused unless I have SPECIFIC questions or already know what to buy. 
    A "System Configuration App" would be a really great sales tool--Just saying.

    I have no idea what "fully optimized" means.
    No Apple device will let you watch broadcast TV. The Apple TV is a good option for watching streaming TV from iTunes, NetFlix and Hulu. If you want to watch from other sources, you may need to look at other devices.
    Any Mac computer or iPad will allow you to surf the web.
    What business software?
    Time Capsule is a good option for back ups.
    Update what across all devices?
    For accessing documents from all devices, a service like Dropbox is your best bet.
    I have no idea what "step as far away from an internet provider as possible" means. If you want Internet access, you need an Internet provider.
    Lighting fast speed for what? Processor? The specs are listed for all devices in the Online Store. Internet? We're back to the service provider.
    Technology changes. The only way to keep pace with it beyond a couple of years is to buy new stuff.
    The bottom line is you need to look at the specs for devices availble and at your budget and decide what best meets your needs. If you are unable to do that on your own, there are lot of technology consultants out there who will, for a fee, look at your exact situation, make recommendations and even handle the purchase and set up. Perhaps that would be the best route for you.
    Best of luck.

  • I need to know how to add closed captioning to a project Captivate 6

    I need to know how to add closed captioning in a project in Adobe Captivate 6.  It is a software demo single recording.  I don't see where to go to create closed captions or change accessilbity preferences.

    Hi there,
    First thing that you need to do is go to Project > Skin editor > and check the box for Closed Captioning button in playbar.
    A slide must have a slide audio or Slide Video to add CC notes in it.
    Go to Windows > Slide notes, to view the slide notes panel, and click on + sign to add Closed captioning notes.
    Please check this article to add CC in project: http://helpx.adobe.com/captivate/using/slide-notes.html
    Check this article for accessibility in Captivate : http://help.adobe.com/en_US/captivate/cp/using/WSc1b83f70210cd101-157ec7f211c7ef6052c-7fff .html
    Thanks.

  • Need help to add the words in a text file to an arraylist

    I am new to java and I really need some help for my project.I want to add the words of a text file to an arraylist. The text file consist of words and the following set of punctuation marks {, . ; : } and spaces.
    thanks in advance :-)

    I/O: [http://java.sun.com/docs/books/tutorial/essential/io/index.html]
    lists and other collections: [http://java.sun.com/docs/books/tutorial/collections/index.html]

  • TS2755 Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help of how to set up messages on each

    Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help on how to set up messages on each device separately and to start using messages app on each device independently. Thanks

    search google for "iphone remove picture from contact"

  • I need to learn how to add a page at the end of my video to put credits?

    I am editing for the first time EVER and need to know how to add credits to the end of a video

    There are different ways to add credits. Did you have anything particular in mind?
    You may find some ideas here:
    How to Create Scrolling Movie Credits in Adobe Premiere Pro - YouTube
    https://helpx.adobe.com/premiere-pro/using/rolling-crawling-titles.html
    Creating and Editing Titles

  • Need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook.......

    need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook? removal of cmos, resetting laptop, using cccleaner, windows password recovery and hiren's was noneffective, any help is appreciated. thanks

    Hi,
    As your notebook is a business class machine, security is more stringent - the password is stored in non-volatile memory and there are no 'backdoor' passwords.  Your best option would be to contact HP regarding this.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • I'm new to SQL Server Integration Services and I need help on how to begin learning SSIS. Is there any training for it besides msdn?

    I'm new to SQL Server Integration Services and I need help on how to begin learning SSIS. Is there any training for it besides msdn?

    Check this thread where people have already given their suggestion on learning SSIS
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f2cc1cf3-204d-454a-a189-47df87a3aa23/i-want-to-learn-ssis?forum=sqlintegrationservices
    I would suggest to go for You tube videos (type learn SSIS or begin SSIS step by step) you will get lot of good tutorials to start with.
    Happy Learning!!
    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

Maybe you are looking for