How to delete a line from a .txt file in node.js?

Stuck in this java program for computer science class?

  • This is a project that tkaes in a txt file being: D:/Documentation/intro-prog-java/media… My holiday photo album blueMotorcycle.jpg, to buy beach-smaller.jpg, Honolulu church.jpg, Religion eiffel.jpg, Paris in the summer and prints it out in a picture album and their captions.. this is supposed to be an upgraded version of the previous programming assignment so my program should have extra things in it that do not do anything but im not sure to delete them or not... I am just stuck right now, i dont want anyone to do this for me but at least give me a hint of where to go next.. here is my program so far import java.io.*; import java.util.*; public class Album { ////////// FIELDS private String albumName; private List<Picture> picture=new ArrayList<Picture>(); private List<String> caption= new ArrayList<String>(); ////////// CONSTRUCTORS public Album() { } // method public Album(String newAlbumName) { this.albumName = newAlbumName; } // method public Album(File fileName) { String line = null; try { BufferedReader reader = new BufferedReader(new FileReader(fileName)); while((line = reader.readLine()) != null){ System.out.println(line); } reader.close(); } catch(FileNotFoundException ex){ SimpleOutput.showError("Couldnt find " + fileName + " please pick it."); } catch (Exception ex){ SimpleOutput.showError("Error reading file " + fileName); ex.printStackTrace(); } } ////////// METHODS public void setAlbumName(String newAlbumName) { this.albumName = newAlbumName; } // method public String getAlbumName() { return this.albumName; } // method public void setPictures(List<Picture> newPictureImageArray) { this.picture = newPictureImageArray; } // method public void setCaptions(List<String> newPictureCaptionArray) { this.caption = newPictureCaptionArray; } // method public void showAlbum() { } ////////// MAIN METHOD public static void main(String[] args) { File source = new File("album.txt"); // Create the album Album myTrip = new Album(source); // Show the album myTrip.showAlbum(); } // main } // class

  • Answer:

    Get NetBeans (very good IDE for beginners)... Step debug your class... You may see yourself what is missing and what needs to be done...

cobbs87 at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.