Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-11-2008, 02:38 AM   #1
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
text duplicator?? help

hey guys,

Say u have a text file with lines:

a
b
c
d
e
f
g
h

are there any programs that can duplicate this, say 10,000 times, so now ull have 10000 a's, 10k b's, 10k c's, etc.

thanks
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 09:41 AM   #2
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
bump......
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 10:29 AM   #3
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
PHP code
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 11:04 AM   #4
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
KNow of any?
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 11:05 AM   #5
Fap
Just Du It
 
Fap's Avatar
 
Industry Role:
Join Date: Feb 2004
Posts: 12,094
copy and paste 10,000x
Fap is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 11:33 AM   #6
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
bump.. come on
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 12:01 PM   #7
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
no program out there does this?
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 01:43 PM   #8
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
bump again..thanks
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 01:45 PM   #9
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
PHP Code:
<?
$a="Some text";
$i=0;
while ($i<10000){
echo "$a";
$i++;
}
?>
PHP Code:
<?
$a="Some text";
$b="Second Text";
$i=0;
while ($i<10000){
echo "$a";
echo "$b";
$i++;
}
?>
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 09:12 PM   #10
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
bump again
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 10:26 PM   #11
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
Hey Bump People
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 10:52 PM   #12
MichaelP
Registered User
 
Industry Role:
Join Date: Aug 2003
Location: QWEBEC Corporate Office
Posts: 7,124
Quote:
Originally Posted by wizzart View Post
PHP Code:
<?
$a="Some text";
$b="Second Text";
$i=0;
while ($i<10000){
echo "$a";
echo "$b";
$i++;
}
?>
exactly
MichaelP is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2008, 10:55 PM   #13
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
that code has a lil problem.. my original file has 1,000 lines, and i wanna dupilicate it to X1000

How will that code work if your original text file is 1000 lines? I need code that can read from text file..
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 01:20 AM   #14
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
Ill pay someone to code this for me!
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 03:05 AM   #15
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
PHP Code:
<? 
$fp = @fopen("txtfile.txt", "rb") or die("Couldn't open txt file"); 
$data = @fread($fp, @filesize($fp)); 
while(!feof($fp)) 

$data .= @fgets($fp, 409600); 


fclose($fp); 

$i=1; 

while ($i<10000)

$text = explode("\n", $data);
echo " $text[$i] ";
$i++; 

?>
Just change in first line txtfile.txt to your txt file

Last edited by wizzart; 03-12-2008 at 03:06 AM..
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 03:10 AM   #16
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
Sorry

Sorry not that code , this is what you need

PHP Code:
<? 
$fp = @fopen("txtfile.txt", "rb") or die("Couldn't open txt file"); 
$data = @fread($fp, @filesize($fp)); 
while(!feof($fp)) 

$data .= @fgets($fp, 409600); 


fclose($fp); 
$i=1; 

while ($i<10000){ 
echo " $data ";
$i++; 

?>
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 05:23 AM   #17
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
wizzart how do i run this??
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 05:36 AM   #18
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
Open you HTML editor and paste this last code and save file as test.php
Open notepad write some text and save file as txtfile.txt

Upload that 2 files to your server and go to http://yoursite.com/test.php and you will see result. ;)
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 05:43 AM   #19
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
script works ok bro.. except it doesnt line break..

Example i put in

a
b

it returns text file as
a b
a b

instead of
a
b
a
b
__________________
_________________
I am the best

Last edited by xxweekxx; 03-12-2008 at 05:43 AM.. Reason: aa
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 05:45 AM   #20
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
im probably asking for me too much but can this possible report the results in text file?
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 06:16 AM   #21
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
bump! can anyone help fix this errro
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 07:33 AM   #22
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
Quote:
Originally Posted by xxweekxx View Post
script works ok bro.. except it doesnt line break..

Example i put in

a
b

it returns text file as
a b
a b

instead of
a
b
a
b
For that do this

PHP Code:
<?  
$fp = @fopen("txtfile.txt", "rb") or die("Couldn't open txt file");  
$data = @fread($fp, @filesize($fp));  
while(!feof($fp))  
{  
$data .= @fgets($fp, 409600);  
}  

fclose($fp);  

$i=1;  

while ($i<10000) 
{  
$text = explode("\n", $data); 
$write = " $text[$i]<br /> "; 
echo "$write";
$i++;  
}  
?>
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 07:47 AM   #23
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
Quote:
Originally Posted by xxweekxx View Post
im probably asking for me too much but can this possible report the results in text file?
Yes it's posible but how much you are ready to pay for that?
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 04:32 PM   #24
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
error with that last script.. it doesnt work, it just reports one LINE, and in source code all i say is <br />
__________________
_________________
I am the best

Last edited by xxweekxx; 03-12-2008 at 04:35 PM..
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 04:49 PM   #25
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
nobody can fix this? ill pay
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 04:56 PM   #26
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
bump again
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 05:21 PM   #27
rowan
Too lazy to set a custom title
 
Join Date: Mar 2002
Location: Australia
Posts: 17,393
Got a dedicated server with ssh login? Create the following script and run it with "sh <scriptname>"

Code:
cp /dev/null output.txt
for x in 0 1 2 3 4 5 6 7 8 9
do
  for y in 0 1 2 3 4 5 6 7 8 9
  do
    for z in 0 1 2 3 4 5 6 7 8 9
    do
      cat input.txt >> output.txt
    done
  done
done
This will append input.txt to output.txt 1,000 times

(There's probably a better way to loop 1,000 times but I'm too lazy to figure it out)
rowan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 06:08 PM   #28
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Can you clarify what you want...

you have the following

a
b
c
d

and you want 1000 lines of:
a b c d

Is that correct?
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 06:12 PM   #29
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Also... Do you just need to do this once? have a standalone script to do this? replace a function in some existing code?
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 06:16 PM   #30
Swish
Confirmed User
 
Swish's Avatar
 
Join Date: Mar 2006
Location: San Diego, CA
Posts: 1,421
Quote:
Originally Posted by rowan View Post
Got a dedicated server with ssh login? Create the following script and run it with "sh <scriptname>"

Code:
cp /dev/null output.txt
for x in 0 1 2 3 4 5 6 7 8 9
do
  for y in 0 1 2 3 4 5 6 7 8 9
  do
    for z in 0 1 2 3 4 5 6 7 8 9
    do
      cat input.txt >> output.txt
    done
  done
done
This will append input.txt to output.txt 1,000 times

(There's probably a better way to loop 1,000 times but I'm too lazy to figure it out)
Code:
for x in `seq 0 999`; do cat input.txt >> output.txt; done
All command line, no script file needed
__________________


Naughty America - Director of Technology
It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!
Swish is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 06:22 PM   #31
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
hit me up, icq: 33385924 I'll hook it up for you for a few bucks...
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 06:23 PM   #32
Swish
Confirmed User
 
Swish's Avatar
 
Join Date: Mar 2006
Location: San Diego, CA
Posts: 1,421
here's the php:

Code:
<?php

$LINES = file("input.txt");

$fp = fopen("output.txt", "w");

for ( $i=0; $i<1000; $i++ ) {
    foreach ( $LINES as $LINE )
        fwrite($fp, "$LINE");
}

fclose($fp);

?>
input.txt is the existing file and output.txt is the new file when complete, save the code as somefile.php upload to server along with input.txt load the somefile.php in your browser or execute on the command line and output.txt will be created
__________________


Naughty America - Director of Technology
It's a CELEBRATION bitches!! For the hottest content promote Naughty America!
swish at naughtyamerica dot com | ICQ: 226 737 620 | See Who I Am At AdultWhosWho.com!

Last edited by Swish; 03-12-2008 at 06:25 PM..
Swish is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2008, 06:54 PM   #33
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
sed and awk are made for this kind of thing. don't even need a program, can do it on the command line.

Hell, even vi can do that.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-13-2008, 12:16 AM   #34
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
eheh jesus nobody can get this right?

your script worked with 2 lines..
then i loaded 2000 lines to be duplicated 1000 times each, and it crapped out..

Doesnt work.. this is getting ridiculous
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-13-2008, 12:16 AM   #35
xxweekxx
Confirmed User
 
Join Date: Oct 2002
Posts: 6,780
Quote:
Originally Posted by brandonstills View Post
sed and awk are made for this kind of thing. don't even need a program, can do it on the command line.

Hell, even vi can do that.

sed and awk and vi.. wow makes lot of sense.. i got no clue what u mean buddy
__________________
_________________
I am the best
xxweekxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-13-2008, 08:03 AM   #36
wizzart
scriptmaster
 
wizzart's Avatar
 
Industry Role:
Join Date: May 2006
Location: Serbia
Posts: 5,237
Quote:
Originally Posted by Swish View Post
here's the php:

Code:
<?php

$LINES = file("input.txt");

$fp = fopen("output.txt", "w");

for ( $i=0; $i<1000; $i++ ) {
    foreach ( $LINES as $LINE )
        fwrite($fp, "$LINE");
}

fclose($fp);

?>
input.txt is the existing file and output.txt is the new file when complete, save the code as somefile.php upload to server along with input.txt load the somefile.php in your browser or execute on the command line and output.txt will be created
That is very clean and nice code :cool:
wizzart is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.