LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-01-2009, 03:05 AM   #1
amani_87
LQ Newbie
 
Registered: Jul 2009
Posts: 3

Rep: Reputation: 0
read only one line from text file


hi everybody,
I want to write a program that continuously prints an incremented value on
the screen in addition to continuously accepting new increment values from the user.
Exactly every one second, the program must print a message on the screen, whether there is input
from the user or not.
The example below illustrates the program’s execution assuming an increment value of 1:
10: Enter new increment value?
11: Enter new increment value? 5
16: Enter new increment value?
21: Enter new increment value?
If there is no input from the user, the same increment value is used. The initial increment value is 1.
The user can change the increment value in three possible ways:
1. By entering an integer value when asked to by the program.
2. By entering a text file name containing the increment value.
3. By sending a signal to the program with the signal number representing the increment value.
If the file name was used before, the next integer value in the file is used. There may be multiple opened files at any given time.

What i want is to give me a solution how to do it with multiples files and forget about the other two ways.
 
Old 12-01-2009, 03:12 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,137

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
So you want to write a program, but you want us to give you the solution ?.
Perhaps you'd better make some effort, and show us your code.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
open text file and read line by line amani_87 Linux - Software 20 01-28-2010 10:25 PM
bash : read every line from text file starting at given line number quadmore Programming 4 02-20-2009 12:29 PM
help with c program to read each line from text file, split line , process and output gkoumantaris Programming 12 07-01-2008 12:38 PM
how do i read a particular line from the text file.. pdklinux79 Linux - Newbie 3 06-09-2008 07:16 PM
read line by line form text file in java. spank Programming 1 10-18-2006 02:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration