wood burning stoves 2.0*
The moose likes Java in General and the fly likes Using Link list to read in a file to emulate command line commands Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using Link list to read in a file to emulate command line commands" Watch "Using Link list to read in a file to emulate command line commands" New topic
Author

Using Link list to read in a file to emulate command line commands

Dan Karp
Greenhorn

Joined: Oct 27, 2013
Posts: 1
I need some help in starting to Write a program in Java that simulates a simple line editor which supports the following operations:

$insert
Each subsequent line, up to the next line editor command, will be inserted in the text. If there is a designated current line, each line is inserted before that current line. Otherwise each line is inserted at the end of the text

$delete m n
Each line in text between lines m and n inclusively will be deleted

$print m n
Display the lines m and n inclusively along with their line
numbers. If the parameters m and n are missing, print the
entire text

$line m
Line m becomes the current line. The program should display up to 3 lines of text along with their line numbers before
and after the current line depending on whether there is
enough text in the linked list

$search string
Search for the string in the text. If found, display the line
that contains the first occurrence of the string

$done
Terminates the execution

The input file will have commands as well as text and also incorrect commands. I need to store the input file info in a linked list.
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2173
    
  47
Welcome to the Ranch.

We won't write it for you but we will answer questions and help you but you need to ask a specific question, what help do you need?
 
jQuery in Action, 2nd edition
 
subject: Using Link list to read in a file to emulate command line commands
 
Similar Threads
travel agent - java writing to file via user input
unable to exit program..
Ending a thread without ending the JVM
travel agent java -- problem when i put the input prompt it does not go to the next promp
linked list help!