I have a (2gb)txt file which has thousands of queries, i need to read those file queries and split those queries into n no. of txt files..and save them in a folder... can any one post an example or guide
chaitu11
0
Junior Poster
Recommended Answers
Jump to PostWhat language?
Jump to PostTo achive this you need to make sure that the each query is written in a single line; so that we can convert each line into an array index.
Example:
$arrayQuery[0] = 'Here goes the first query'
$arrayQuery[1] = 'Here goes the second query'Following is the code:
Jump to PostIt sounds like you have a file with 10000+ lines in it, that you need to split into 50 line chunks and save to new files...
If the file is well over your php memory limit, reading the whole thing into memory will only cause you headaches.
I'd highly suggest …
All 11 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
chaitu11
0
Junior Poster
chaitu11
0
Junior Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
peeyush.budhia
0
Newbie Poster
chaitu11
0
Junior Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
peeyush.budhia
0
Newbie Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
mschroeder
251
Bestower of Knowledge
Team Colleague
chaitu11
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.