• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Dan Karp
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2988
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic