• Welcome to DNForum.com - Domain Investor Forum, Free Domain Marketplace and a community for 45+ domain pros
    If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the oldest global domain name community on the internet and continues to grow every day. There are over 45,000 domainers on DNForum doing everything from buying domains, selling domains, using our free in-house built tools, learning about domains and discussing domains. Take a minute and Register.

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!
 
Do you have linux server?

if so, very easy...

cat INPUTFILE | grep -i "a" > OUTPUTFILE

will output to OUTFILE all lines that contain "a"
 
Please windows, preferably an addon in DRT or a fast make php script ;)
 
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.
 
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.
 
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!
 
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!
 
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.
Back
Top Bottom