Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

Big list of data extract? How?

  • Thread starter Thread starter tekz999
  • Start date Start date
Status
Not open for further replies.
T

tekz999

Guest
Lets say I have a list like this:

apple
banana
cat
dog

I want to extract all lines with "a", so result is like this:
apple
banana
cat

Any idea how? Thanks!
 

Luc

Old school
The Originals
Legacy Exclusive Member
Joined
Jul 18, 2002
Messages
1,574
Reaction score
5
Do you have linux server?

if so, very easy...

cat INPUTFILE | grep -i "a" > OUTPUTFILE

will output to OUTFILE all lines that contain "a"
 
T

tekz999

Guest
Please windows, preferably an addon in DRT or a fast make php script ;)
 

Luc

Old school
The Originals
Legacy Exclusive Member
Joined
Jul 18, 2002
Messages
1,574
Reaction score
5
sorry man, for big lists PHP will fail due to execution timeout, or memory usage.

if you need processing now, you can send list, i can process and send back. PM me for email address.
 
T

tekz999

Guest
Thanks luc! But I really need to do this myself ;)

I remember I can put a list of words within an area in the php file, then input the letter/word I am looking for in another area, then it will run, and auto-save it as a new file, then I simply login to FTP and download the newest file.
 

Luc

Old school
The Originals
Legacy Exclusive Member
Joined
Jul 18, 2002
Messages
1,574
Reaction score
5
well. if you have file on server, you can run this command from php...

PHP:
<?php

exec('cat INPUTFILE | grep -i "a" > OUTPUTFILE');

?>

there are a million ways to do it, but i am too lazy to write the php code, it's best to execute from server. good luck!
 
T

tekz999

Guest
It worked @.@
Thanks for the great help Luc!

How do I make it run and capitalize the first letter after a "space"?

e.g.
apple orange

becomes:
apple Orange

Thanks!
 

Luc

Old school
The Originals
Legacy Exclusive Member
Joined
Jul 18, 2002
Messages
1,574
Reaction score
5
in the php file, the exec should have this..

exec('cat INFILE | grep -i "a" | sed "s/ [a-zA-z]/\U&/gi" > OUTFILE');
 
Status
Not open for further replies.
Top Bottom