LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2010, 09:52 AM   #1
poonamkhirolia
LQ Newbie
 
Registered: Dec 2010
Posts: 8

Rep: Reputation: 0
program to reverse a file


Write a program in any language you choose, to reverse a file.
 
Old 12-17-2010, 10:10 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Smells like homework to me -- like the OP's other threads, 6 started in 30 minutes.
 
Old 12-17-2010, 10:11 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

If by reverse you mean last line first, first line last: Try tac (Yep, that is cat in reverse).

Hope this helps.

EDIT:
Mmmmm..... catkin seems to have a good point......
/EDIT

Last edited by druuna; 12-17-2010 at 10:12 AM.
 
Old 12-17-2010, 11:25 AM   #4
tsg
Member
 
Registered: Mar 2008
Posts: 155

Rep: Reputation: 30
Quote:
Originally Posted by poonamkhirolia View Post
Write a program in any language you choose, to reverse a file.
Why would I want to do that?
 
Old 12-17-2010, 11:42 AM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by tsg View Post
Quote:
Write a program in any language you choose, to reverse a file.
Why would I want to do that?
So that you can still read the file on 'Opposite Day' ...
 
Old 12-17-2010, 02:56 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Quote:
Originally Posted by poonamkhirolia View Post
Write a program in any language you choose, to reverse a file.
You are not helping yourself by repeated homework style posts. Warning!
 
Old 12-25-2010, 03:40 AM   #7
poonamkhirolia
LQ Newbie
 
Registered: Dec 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by druuna View Post
Hi,

If by reverse you mean last line first, first line last: Try tac (Yep, that is cat in reverse).

Hope this helps.

EDIT:
Mmmmm..... catkin seems to have a good point......
/EDIT
Thanks it's working!!!!!
 
Old 12-25-2010, 03:43 AM   #8
poonamkhirolia
LQ Newbie
 
Registered: Dec 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by onebuck View Post
Hi,



You are not helping yourself by repeated homework style posts. Warning!
Thanks those links are of great help!!!!
 
Old 12-25-2010, 02:33 PM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

I'm glad to be of help!
 
  


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
Reverse Tunneling / Reverse port forwarding in SSH dynamics Linux - Networking 5 02-07-2017 07:19 AM
Reverse DNS lookup from a file mlapl1 Linux - Newbie 3 10-04-2009 08:46 PM
C to Reverse a Text File. aatwell Programming 19 01-24-2009 10:12 AM
Reverse Sort Text File BxBoy Linux - General 1 08-02-2004 10:13 AM
How can you reverse engineer a small C program OrganicX Programming 1 01-30-2004 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:30 AM.

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