• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to replace existing content in afile and update content every time it create file ?

 
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

im using file.write its append the content every time its create a file i want to update a content in a existing file everytime
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not clear what exactly you're trying to do (maybe you can elaborate), but the RandomAccessFile class can update data in the middle of a file (assuming the file has a fixed, known format).

If you want to get rid of the previous contents altogether, then "StandardOpenOption.APPEND" is probably not the right option to use :-)
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Directory(sata1)
└── subDirectory(pm8)
      └── subDirectory(data)
           └── subDirectory(pmin)
                 └── subDirectory(year)
                   └── subDirectory(yearM)
                       └── subDirectory(year)
                                 ├── folder1
                                 ├── folder2
                                 └── folder3

i hope nw its clear
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for last comment basically if i remove append the content is not cuming full in file i want remove existing content and overwrite the new content in same file rajveer7 hope You got my point
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That sounds like it should not happen, but without seeing an SSCCE it's hard to tell.

Have you tried deleting the file before writing the data? That might be the fastest solution to this problem.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i dont want to delete manually either it deletes the existing file with new file from the code
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apparently not? I wasn't suggesting to delete the file manually - you can do it programmatically.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yup thats wht im asking where to delete the file in code
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are sections in this Java™ Tutorials trail about copying, moving, deleting, etc. files.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

by deleting im not getting the complete content in file
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you made sure that html.getBytes(StandardCharsets.UTF_8) contains everything you think it should contain?
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use Files.write() with a byte array parameter if you're working with textual data. Split your HTML into separate lines first. You can also perform the delete and write in one step:
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks stephan well html is already in innertext as string
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Non sequitur? Have you tried what Stephan suggested? If not, start with that.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and truncate is working but without append im not getting the complete string in the file and append+truncate cant work together
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
     if(wb1.getLocation().contains("&ini=")){
                 JOptionPane.showMessageDialog(null, "got "+wb1.getLocation());
 String html = (String) wb1.executeScript("document.documentElement.innerText");
                System.out.println(html);
content is coming from this part
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and string output is coming like this |[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-20 11:47:31|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-20|work_till=2017-09-20 23:59:59|work_from=2017-09-20 00:00:00|ns=pmin|centre=delhi|ymd=20170920|bar=PM Workdate: 2017-09-20 NS: pmin From: 2017-09-20 00:00:00 Till: 2017-09-20 23:59:59||[pml]|work_date_long=Wednesday, 20th September 2017|work_date=2017-09-20|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170920|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170920|
|[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-20 11:47:31|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-20|work_till=2017-09-20 23:59:59|work_from=2017-09-20 00:00:00|ns=pmin|centre=delhi|ymd=20170920|bar=PM Workdate: 2017-09-20 NS: pmin From: 2017-09-20 00:00:00 Till: 2017-09-20 23:59:59||[pml]|work_date_long=Wednesday, 20th September 2017|work_date=2017-09-20|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170920|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170920|


MMS Print

Home Page
UTC 2017-09-20 11:50:00

Print Media

Set Workdate | Manage Papers | Import Scans | Mark Scans | Cut Scans | File Cuts | Copy Cuts for OCR | Copy OCR | Mark Cuts | Pending | Reports

Classify Clips | Check Clips | Headlines | Prioritise | Sections | Search | PM Upload | Output | PM Mails

Miscellaneous

Report | CD | Sources | Archives | Centres

Classify

Auto Classify | Subjects | Queries | Translit

Miscellaneous

Logout
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:Have you tried what Stephan suggested? If not, start with that.

 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i had tried that why i told that truncate_existing cant be work with append and without append content is not saving complete in a file
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
APPEND has nothing to do with your problem. You don't want to append lines, you want to write them from the start. There's likely something else going on.

Write a small program that uses my suggestion, that displays the problem you're having. Hardcode the HTML you're having the problem with in the application, so we can just run your application to see what's going on.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
k but for running my application you have to login.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to produce the equivalent code with no other extras.

Indeed, by doing that you might see either the issue, or where the issue isn't.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
with no extra you will not be able to see the problem because every action is going on through the application.
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue you are having is with the writing to the file (something like that, I'm really not clear what the goal is if I'm honest).
So it should be possible to show that it's a File writing issue by extracting the file writing code and seeing how that works for different HTML data.

Now, should that not cause the issue then it is likely not the file writing that's the issue here.
That's when you look at the source data and see if there's something up with that.

Neither of those require your full code to deal with.
I don'e see why you can't stub out most of the other stuff.

That's how to break down an issue like this, otherwise there's so much going on that it's hard to isolate where the actual issue lies.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but thats come when i load my application in webEngine() because that come in application only through db and i dont have the access of db so i can only provide the code with loading the application url in webEngine()?
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So instead of loading from web engine load a hard coded html or a html file and see where the issue is with writing.
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you run your program? If it's in an IDE, you can put a breakpoint after the line that assigns a value to your html variable. Then inspect the value of the variable. If you're running from the command line, use System.out.println() to write the variable to the standard output, and pipe the output to a file.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IM ALREADY PRINTING THE OUTPUT  THIS IS THE CODE
String html = (String) wb1.executeScript("document.documentElement.innerText");
                System.out.println(html);
THATS WHY IM GETTING IT IN CONSOLE
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, when you are writing the text to the file, it doesn't write the full text and gets truncated?
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't shout.

The text that you posted above that gets printed to console, is that the complete text you expect to be in the file, or is there still something missing?
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes Stephan that is the complete text i except to be in file
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes swastik you are write
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the obvious (to me) difference is that you are sending the output as a byte[], including the character set, which could well be mucking the data up, whereas your println() call to log just uses the String directly, with no messing about.

So, how about trying to print the byte[]?  You'll need to use out.write instead of out.println.

I would try it out myself, but I have no idea what the actual data looks like that you are expecting to output.  The earlier post doesn't clearly identify what you expect and what you get.
Also, there's no guarantee it's not around the encoding of the original html, so copy/paste from here wouldn't show that.
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im printing before saving so how does it matter with this dave? you can try it out yourself also i can provide the complete code
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the bits of code you posted, this is how you are logging the html:


and this is how you are supplying it to the file:


Those are not the same thing.
As I said (and Tim earlier), getBytes(StandardCharsets.UTF_8) may be causing your issues.

So try and log the text the same way:
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
k thanks dave i had tried with System.out.write(html.getBytes(StandardCharsets.UTF_8)); also its also printing the complete content to the console. but the main prob is in saving in .ini file
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is there any other way to save.ini file like.txt only or there is some other way ?
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
                 
see nw i had tried like this but still a same prob each time its append in same file and nt replacing the old content in a file
 
Niti Kapoor
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
|[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-21 18:02:29|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-22|work_till=2017-09-21 23:59:59|work_from=2017-09-21 00:00:00|ns=pmin|centre=delhi|ymd=20170922|bar=PM Workdate: 2017-09-22 NS: pmin From: 2017-09-21 00:00:00 Till: 2017-09-21 23:59:59||[pml]|work_date_long=Friday, 22nd September 2017|work_date=2017-09-22|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170922|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170922||[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-21 18:02:29|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-22|work_till=2017-09-21 23:59:59|work_from=2017-09-21 00:00:00|ns=pmin|centre=delhi|ymd=20170922|bar=PM Workdate: 2017-09-22 NS: pmin From: 2017-09-21 00:00:00 Till: 2017-09-21 23:59:59||[pml]|work_date_long=Friday, 22nd September 2017|work_date=2017-09-22|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170922|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170922||[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-21 18:02:29|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-22|work_till=2017-09-21 23:59:59|work_from=2017-09-21 00:00:00|ns=pmin|centre=delhi|ymd=20170922|bar=PM Workdate: 2017-09-22 NS: pmin From: 2017-09-21 00:00:00 Till: 2017-09-21 23:59:59||[pml]|work_date_long=Friday, 22nd September 2017|work_date=2017-09-22|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170922|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170922|

MMS Print

Home Page
UTC 2017-09-21 06:06:46

Print Media

Set Workdate | Manage Papers | Import Scans | Mark Scans | Cut Scans | File Cuts | Copy Cuts for OCR | Copy OCR | Mark Cuts | Pending | Reports

Classify Clips | Check Clips | Headlines | Prioritise | Sections | Search | PM Upload | Output | PM Mails

Miscellaneous

Report | CD | Sources | Archives | Centres

Classify

Auto Classify | Subjects | Queries | Translit

Miscellaneous

Logout

//second time saving the file but its save after old content only its not replacing old content or file with new
|[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-21 18:06:38|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-22|work_till=2017-09-21 23:59:59|work_from=2017-09-21 00:00:00|ns=pmin|centre=delhi|ymd=20170922|bar=PM Workdate: 2017-09-22 NS: pmin From: 2017-09-21 00:00:00 Till: 2017-09-21 23:59:59||[pml]|work_date_long=Friday, 22nd September 2017|work_date=2017-09-22|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170922|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170922||[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-21 18:06:38|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-22|work_till=2017-09-21 23:59:59|work_from=2017-09-21 00:00:00|ns=pmin|centre=delhi|ymd=20170922|bar=PM Workdate: 2017-09-22 NS: pmin From: 2017-09-21 00:00:00 Till: 2017-09-21 23:59:59||[pml]|work_date_long=Friday, 22nd September 2017|work_date=2017-09-22|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170922|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170922||[server]||[app]|host_name=pmms.ankiti.com|ns=|session_name=pmms_ankiti_com|lang=en||[portal]|host_name=mms.ankiti.com|ns=|locale=en|domain=pmms.ankiti.com|ent_id=|app=mm-pmms|sec_ns=ankiti|sec_conf=sec-staff-lgc|sec_permissions=mms.ankiti.com|locales=mmstech|email=service@pressmonitor.com|email_name=Press Monitor|email_cc=news@ankiti.com||[shell]|id=wssoj75f2|host_name=pmms.ankiti.com|domain=ankiti.com|ent_id=|locale=|head= |header_bar=

MMS Print

|header_brand=|header_menu=|footer_bar=|footer_brand=|footer_menu=|change_at=2017-07-04 03:38:25||[user]|id=7f701032821e1e4d69cfcf7ee|ns=ankiti|ent_id=ank-1|code=mm-dc-rajveer|name=Rajveer verma|user_id=rajveersingh.kumar5@gmail.com|password=$2y$10$b8SLaZYPW/XAZWHWgaVg0.aL4L6sxgmpEnZrOLsGiC3hQu/22xR/m|password_old=*AAD9BAB0626ADA4743CC7582CC20E992C509D43|phone=9990367022|status=|status_remark=|permissions=mms.ankiti.com|created_at=2016-08-14 04:47:47|login_at=2017-09-21 18:06:38|change_at=2017-06-07 14:23:13|logout=`sec_loggedinas Rajveer verma `sec_logout||[pm]|work_date=2017-09-22|work_till=2017-09-21 23:59:59|work_from=2017-09-21 00:00:00|ns=pmin|centre=delhi|ymd=20170922|bar=PM Workdate: 2017-09-22 NS: pmin From: 2017-09-21 00:00:00 Till: 2017-09-21 23:59:59||[pml]|work_date_long=Friday, 22nd September 2017|work_date=2017-09-22|year_data_dir=//192.168.2.18/pm8/data/pmin/2017|month_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709|date_data_dir=//192.168.2.18/pm8/data/pmin/2017/201709/20170922|date_data_path=/sata1/pm8/data/pmin/2017/201709/20170922|

MMS Print

Home Page
UTC 2017-09-21 06:08:35

Print Media

Set Workdate | Manage Papers | Import Scans | Mark Scans | Cut Scans | File Cuts | Copy Cuts for OCR | Copy OCR | Mark Cuts | Pending | Reports

Classify Clips | Check Clips | Headlines | Prioritise | Sections | Search | PM Upload | Output | PM Mails

Miscellaneous

Report | CD | Sources | Archives | Centres

Classify

Auto Classify | Subjects | Queries | Translit

Miscellaneous

Logout

this is hw file is saving
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't tell from the mass of text which parts are from the System.out.write() and which are from the file itself.

As for why your new bit of code is appending:

you asked it to in the constructor.

If you don't want to append then set it to false.
 
Don't listen to Steve. Just read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic