LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 10: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, 11:10 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

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

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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 11:12 AM.
 
Old 12-17-2010, 12:25 PM   #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, 12:42 PM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
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, 03:56 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,549
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
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, 04: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, 04: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, 03:33 PM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,549
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

I'm glad to be of help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 3 11-23-2009 11:31 AM
Reverse DNS lookup from a file mlapl1 Linux - Newbie 3 10-04-2009 09:46 PM
C to Reverse a Text File. aatwell Programming 19 01-24-2009 11:12 AM
Reverse Sort Text File BxBoy Linux - General 1 08-02-2004 11:13 AM
How can you reverse engineer a small C program OrganicX Programming 1 01-30-2004 09:30 PM


All times are GMT -5. The time now is 05:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration