gio001 has asked for the wisdom of the Perl Monks concerning the following question:
I have it working ok for small sizes of largeFile2. I can see a problem when the size of file2 gets large. I hope you can give me some suggestions on how to do this better. Thanks!FileContent=$(awk '{print $0}' largeFile2) # this is where I think I h +ave a problem : # LINE contains start and offset identifying each record in largeFile2 while read LINE;do pass=1 for results in $LINE; do if [[ $pass -eq 1 ]];then from=$results pass=2 else to=$results fi done (( from=$val1+1 )) (( to=$val1+$val2 )) newOut=$(echo $FileContent|cut -c $from-$to) echo $newOut >> newfile done < indexFile1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read offset into other files
by GrandFather (Saint) on Oct 18, 2008 at 05:07 UTC | |
|
Re: Read offset into other files
by BrowserUk (Patriarch) on Oct 18, 2008 at 07:38 UTC | |
by gio001 (Acolyte) on Oct 18, 2008 at 15:35 UTC | |
by BrowserUk (Patriarch) on Oct 18, 2008 at 16:53 UTC |