|
![](/i/fill.gif) |
"Gunnar" <nomail@nomail> wrote:
> "Penelope20k" <pen### [at] caramail fr> wrote:
> > ill will do like this
> > I read the data and create an include file containing all My_data[index] =
> > value;
> >
> > then when all the txt file is read, i will declare the size of array and
> > include the .inc file
> >
> > (please correct typo)
> >
> >
> > #declare convert_file=on; // switch here if you dont need to convert each
> > time
> >
> >
> > #if(convert_file)
> > #fopen My_file_ACR "12440_ACR.txt" read
> > #fopen My_data_ACR "My_Data_ACR.inc"
> >
> > #declare index=0;
> > #while(defined(My_file_ACR))
> > #read (My_file_ACR, a,b,c)
> > #declare vector=<a,b,c>;
> > #write (My_Data_ACR,"#declare my_data[",index,"]=",vector,";n")
> > #declare index=index+1;
> > #end
> >
> > // close files here
> >
> >
> > #end // end of if statement
> >
> >
> >
> > #declare my_data=array[index] // the one resulting of the loop
> > // then
> > #include my_data_acr.inc
> >
> >
> >
>
> I will have a try, thanks for the suggestion! Seems to be a nice idea.
Works great after adding a semicolon here and a "write" there. Thanks a
lot!!!
Post a reply to this message
|
![](/i/fill.gif) |