Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2006

Tip: Looking for answers? Try searching our database.

Reading Fixed Length Record File

Thread view: 
cksanjose - 27 Oct 2006 17:01 GMT
Hi everyone!

I have to read a text file with fixed length record. The file can be in
2 formats. The first one has linefeed terminator for each record. The
second format does NOT have a linefeed.
What would be the best way of reading this text file.

Thanks,
Cesar
Andrew Thompson - 27 Oct 2006 17:53 GMT
...
> I have to read a text file with fixed length record.

All of it?  Or just parts?

>..The file can be in
> 2 formats. The first one has linefeed terminator for each record. The
> second format does NOT have a linefeed.
> What would be the best way of reading this text file.

Depends on things you didn't mention.

e.g. If it's a) from above, I'd tend to use a line reader..
if b) a RandomAccessFile.

Andrew T.
Brandon McCombs - 28 Oct 2006 00:29 GMT
> ...
>> I have to read a text file with fixed length record.
[quoted text clipped - 12 lines]
>
> Andrew T.

He didn't mention them but it seems that you did just fine being able to
answer his question by giving him the options he has so what's the big
deal? If you couldn't answer him at all then I could see it as being a
problem but if his information wasn't preventing you from helping him,
and in this case it wasn't, then why complain that he didn't mention
something?

While writing a post someone can't necessarily think of every single
piece of information they need to include in order to get a response
from someone else, or they may leave out info that they think isn't
pertinent, or give too much information. Whatever the case is there
isn't any need to point it out unless it detracts from the advice that
is given. You still gave him advice that covers his problem so if he
didn't specify everything up front, so what?
Lew - 28 Oct 2006 17:25 GMT
>> ...
>>> I have to read a text file with fixed length record.

>> All of it?  Or just parts?

>>> ..The file can be in
>>> 2 formats. The first one has linefeed terminator for each record. The
>>> second format does NOT have a linefeed.
>>> What would be the best way of reading this text file.

>> Depends on things you didn't mention.
>>
>> e.g. If it's a) from above, I'd tend to use a line reader..
>> if b) a RandomAccessFile.

> He didn't mention them but it seems that you did just fine being able to
> answer his question by giving him the options he has so what's the big
[quoted text clipped - 10 lines]
> is given. You still gave him advice that covers his problem so if he
> didn't specify everything up front, so what?

As I read Andrew's post, his questions *are* part of the advice.  He's helping
the OP by giving examples of questions the OP can ask themself, which
questions will empower the OP to achieve answers independently, thus improving
the OP's skills.  If Andrew had spoon-fed the answers without giving the
reasoning behind them, the OP would not have benefited as much.

It is well-established good practice to think through a programming (or any
engineering) problem in detail.  By encouraging folks to do that, Andrew is
helping them. It's also more effective at getting useful answers on Usenet to
phrase one's questions thoroughly and precisely.

"Build a man a fire, you warm him for an hour.
Set a man on fire, you warm him for the rest of his life."

- Lew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.