![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
![]() I would need a simple program/script that can merge 2 txt-files into one. The way it should be done is that the first line from txt1.txt should be written into txt3.txt, then the first line from txt2.txt should be written at the end of the first line in txt3.txt, then the second line from txt1.txt and second line of txt2.txt should appear on line 2 in txt3.txt etc.
so when viewing txt3.txt it would look just like if i have created 2 tables on a webpage listing txt1.txt in the first one and txt2.txt in the second. Am i making any sense? if so, please help me out if anyone have something to do this, Thanks! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Mar 2001
Location: Florida
Posts: 6,138
|
should be simple with a few unix commands, i forget what they are though ;(
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Feb 2002
Location: Brisbane, Australia
Posts: 3,970
|
unix is simple. but you have to be a genius to understand its simplicity.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
I will be more than happy for the time being if i just know how to merge a couple of files in the way described
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Mar 2001
Location: Florida
Posts: 6,138
|
ok, i remember now...
cat file1 file2 > file3 from a unix command line |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
So Fucking Banned
Join Date: Dec 2002
Location: New York.... Not the city... Up north further. Its about a six hour drive to the city from here. I don't like the city much. The air is not as clean, but they do have better strip clubs.
Posts: 1,026
|
well heres a simple little php script that would do it....
Echo it to the screen then just save as .TXT PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Too lazy to set a custom title
Join Date: Nov 2002
Posts: 16,714
|
for i in $(ls file*)
do cat $i >> nameofnewfile done <enter> then the compiled file will be nameofnewfile
__________________
A fast fortune is easy to earn! Just go with a winner! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
pornJester: nah, that will only add the files after eachother..
MonkeyMan: great! thx! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
So Fucking Banned
Join Date: Dec 2002
Location: New York.... Not the city... Up north further. Its about a six hour drive to the city from here. I don't like the city much. The air is not as clean, but they do have better strip clubs.
Posts: 1,026
|
Nat please recopy the code or replace $START with the number 0
I forgot to do that. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Mar 2001
Location: Florida
Posts: 6,138
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
MonkeyMan: em, help?
![]() Parse error: parse error in /home/html/index.php on line 5 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Too lazy to set a custom title
Join Date: Nov 2002
Posts: 16,714
|
Quote:
imadaddy.txt imadaddy2.txt imadaddy3.txt then do im*
__________________
A fast fortune is easy to earn! Just go with a winner! |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
im*? what command are you reffering to?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Too lazy to set a custom title
Join Date: Nov 2002
Posts: 16,714
|
for i in $(ls im*)
do cat $i >> nameofnewfile done this will combine all files that start with im into the 'nameofnewfile'
__________________
A fast fortune is easy to earn! Just go with a winner! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
So Fucking Banned
Join Date: Dec 2002
Location: New York.... Not the city... Up north further. Its about a six hour drive to the city from here. I don't like the city much. The air is not as clean, but they do have better strip clubs.
Posts: 1,026
|
Quote:
ooops on this line add the ; $length = 1000; and make shre you replace "(APPROX FILE LENGTH)" with a number you should have PHP Code:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
yes, but it will just add txt2.txt to the end of txt1.txt, but i want them to be added on the same line, line for line... reread my first post for a better explanation...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Confirmed User
Join Date: Sep 2001
Posts: 553
|
Great! got it working...
thanks! |
![]() |
![]() ![]() ![]() ![]() ![]() |