My code below works ,I cannot take that code into a variable since its a huge file which i am trying to get geavg.t00z.pgrb2af18 files and many more like this
Yes. My bad for not being specific. I was just posting how to extract the variable.
I was thinking loop over the file with an array..
pseudo (untested)
while read line
do
name=$line
if [[ $line == *fooBar* ]]; then #Some Search condition
line1="${line##*href\=\"}"
line2="${line1%\"\>*}"
array+=("$line2")
fi
done < $file
I'm confused: Are you briandanielz or are you ajayram_arya? Both of you seem to be answering questions about what is wanted and posting very similar segments of code that you're using to solve parts of the problem.
Shell array sizes in both ksh and bash are limited. Since your input is a "huge file", the shell array limits may be your problem.
What are you going to do with the array after you have processed your "huge file"? Can't you instead process the data from each line in your huge file as you find it without keeping a list of that data from all of the lines you've processed in an array?