comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Fast editing of text file?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Fast editing of text file? [message #44472 is a reply to message #44469] Thu, 16 June 2005 01:05 Go to previous messageGo to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> It might be that the concatenation of these three components could be
> done more quickly by a system command like Unix "cat". In other words
> you would have file_top and file_bottom containing the unchanging bits;
> IDl would write a new version of file_middle each time, then
>
> spawn, "cat file_top file_middle file_bottom > file"
>
> On the other hand it could be slower...

This seems to be pretty fast. I created a three files: file of first 11
lines, file of the 12th line and another file for all the remaining
lines. I made the last file 150,000 lines long just for the fun of it.

$ wc -l upper.txt middle.txt lower.txt
11 upper.txt
1 middle.txt
150000 lower.txt
150012 total
$ date && cat upper.txt middle.txt lower.txt > test.txt; date
Thu Jun 16 02:56:29 CDT 2005
Thu Jun 16 02:56:29 CDT 2005
$ wc -l test.txt
150012 test.txt

So, doing the concatenation took under a second. My machine is good,
but not blazingly fast.

-Mike
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How does IDL find functions?
Next Topic: ASCII read problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 05:20:00 PDT 2025

Total time taken to generate the page: 0.00607 seconds