• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not writing to new file...

 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all!

This window is part of a project I'm working on. It is supposed to take in a customer's ID number and validate it (the validation as far as I've tested it works perfectly fine). A new file, rewritten.txt, is then created. It reads from the customer information file and rewrites the customer information file to it, making any changes to the customer information that the user has entered and simply rewriting the data otherwise. The problem is, it doesn't write to the rewritten file at all and I can't figure out why. Another window I wrote is similar, yet it does the file writing correctly. Here I'm testing it to make sure it rewrites properly, I'm not actually using the code that makes changes from the original file. I'm sure this is something simple and small that I'm missing, it usually is. Code is below, important stuff bolded...



If it helps to make sense of the code, the original customer information (basicCustomerInfo.txt) file is in the following format:

1. 0802636
2. Joe Schmo
3. 123 Main St.
4. Apt 3b.
5. Anywhere , NJ
6. 12345
-----
1. 1837844
2. Jane Doe
3. 98 Sherry Ave.
4.
5. Someplace , NY
6. 01010
-----

[ March 20, 2006: Message edited by: Brandi Love ]
JCE: broke up long lines
[ March 20, 2006: Message edited by: Joe Ess ]
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see "pw.close()" anywhere in those many lines of code. You have to close your file after you finish writing to it.
 
Brandi Love
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure this is something simple and small that I'm missing, it usually is.


Silly mistake, lol. Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!