On Jan 4, 5:25 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> jo3c wrote:
> > i have a 2000 files with header and data
> > i need to get the date information from the header
> > then insert it into my database
> > i am doing it in batch so i use glob.glob('/mydata/*/*/*.txt')
> > to get the date on
jo3c wrote:
> i have a 2000 files with header and data
> i need to get the date information from the header
> then insert it into my database
> i am doing it in batch so i use glob.glob('/mydata/*/*/*.txt')
> to get the date on line 4 in the txt file i use
> linecache.getline('/mydata/myfile.txt/,
hi everyone happy new year!
> im a newbie to python
> i have a question
> by using linecache and glob
> how do i read a specific line from a file in a batch and then insert
> it into database?
>
> because it doesn't work! i can't use glob wildcard with linecache
>
i have a 2000 files with header and data
i need to get the date information from the header
then insert it into my database
i am doing it in batch so i use glob.glob('/mydata/*/*/*.txt')
to get the date on line 4 in the txt file i use
linecache.getline('/mydata/myfile.txt/, 4)
but if i use
linecac
linecache.getline(filename, 4)
Maybe you could explain more about what you are trying to do and we
could help more?
Hope this helps,
Jeremy
On Jan 3, 10:02 pm, jo3c <[EMAIL PROTECTED]> wrote:
> hi everyone happy new year!
> im a newbie to python
> i have a question
> by using li
hi everyone happy new year!
im a newbie to python
i have a question
by using linecache and glob
how do i read a specific line from a file in a batch and then insert
it into database?
because it doesn't work! i can't use glob wildcard with linecache
>>> import linecache
&g