Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Need help with your homework? Need help with a homework question on any programming language? Post questions and help here, not in the language topic forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Need help with your homework? section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 19th, 2006, 04:59 AM
Authorized User
 
Join Date: Dec 2005
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to read bin file backward

hi
please i want your help in this

how to read a file with .bin extention backward

thank you

Reply With Quote
  #2 (permalink)  
Old March 21st, 2006, 07:29 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

read it into a variable or array and reverse that. For example in perl:
#!/usr/bin/perl -w
use strict;

# first read text file
open IN,'test.txt';
my @lines = <IN>;
close IN;

# reverse the order of our array and loop through
for (reverse @lines) {
  # reverse the characters in the line
  # reverse expects a LIST so we split $_ first
  print reverse split //,$_ ;
}


--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read Text file and convert to Binary file VB.net sjlsysprg1 Pro VB.NET 2002/2003 4 June 29th, 2007 06:53 AM
Restore file from Recycle Bin eelisMX Pro VB.NET 2002/2003 0 December 8th, 2006 09:53 AM
Backward Compatibility Neal Crystal Reports 1 March 23rd, 2006 10:48 AM
owc 10 backward compatibility sriram s General .NET 0 April 19th, 2004 10:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.