I am very sorry if this has been posted before, but I did do a search and after looking through the first ten pages or so, I didn't find what I was looking for...
I am trying to merge two seperate text files together, essentially taking what is on the first line of one document, and adding it to what is on the first line of another document...For instance:
Text File A has the questions (one per line)
Question A
Question B
Question C
Text File B has the answers
= Answer A
= Answer B
= Answer C
How can I merge the two documents together, to create Text File C..?
Question A= Answer A
Question B= Answer B
Question C= Answer C
Thanks for your help...
AYHJA
Merging Two Seperate Text Files Together...
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
You could add
letter a to all line starts in question file (find ^ replace by a)
then insert numbers (Edit - Fill block) with leading numbers before the a's (so they are all the same length.
Now repeat with answer file and letter b.
Your files look now like
001a Question A
002a Question B
003a Question C
001b Answer A
002b Answer B
003b Answer C
Now, add all the content of answer file to question file.
Then use Tools - Sort to sort the file - the result should look like
001a Question A
001b Answer A
002a Question B
002b Answer B
003a Question C
003b Answer C
now remove the first columns (block mode select) and you have
Question A
Answer A
Question B
Answer B
Question C
Answer C
Now you have to remove every second line break.
There was a thread about this just today or yesterday, see there.
letter a to all line starts in question file (find ^ replace by a)
then insert numbers (Edit - Fill block) with leading numbers before the a's (so they are all the same length.
Now repeat with answer file and letter b.
Your files look now like
001a Question A
002a Question B
003a Question C
001b Answer A
002b Answer B
003b Answer C
Now, add all the content of answer file to question file.
Then use Tools - Sort to sort the file - the result should look like
001a Question A
001b Answer A
002a Question B
002b Answer B
003a Question C
003b Answer C
now remove the first columns (block mode select) and you have
Question A
Answer A
Question B
Answer B
Question C
Answer C
Now you have to remove every second line break.
There was a thread about this just today or yesterday, see there.
- AYHJA
- Posts: 4
- Joined: Thu Nov 25, 2004 11:28 am
- Location: In this bish right, right, right thurr...
- Contact:
Thanks..!
I appreciate your help, I should be good on that...
One more question...And I promise I'm reading the help files before I ask questions...
I am trying to insert a return after a certain group of characters...
For example:
ImageTagEnding ImageTagBeginning
to
ImageTagEnding
ImageTagBeginning
I don't see a syntax code for a carriage return...Thanks in advance...
AYHJA
One more question...And I promise I'm reading the help files before I ask questions...
I am trying to insert a return after a certain group of characters...
For example:
ImageTagEnding ImageTagBeginning
to
ImageTagEnding
ImageTagBeginning
I don't see a syntax code for a carriage return...Thanks in advance...
AYHJA
- AYHJA
- Posts: 4
- Joined: Thu Nov 25, 2004 11:28 am
- Location: In this bish right, right, right thurr...
- Contact:
Can't get it right...
I tried that, and in did something really weird w/the contents of the page, so I know I did something wrong...
I don't have word wrapping on, btw, and here's what I'm trying to do...I have several BBcode links together, that are seperated by a single space...I want to convert those spaces into returns...This is how it looks:
[/URL] [URL=
I want to put a return where that space is inbetween the two of them...Do I need to include more text before and after each point to make it work..?
AYHJA
I don't have word wrapping on, btw, and here's what I'm trying to do...I have several BBcode links together, that are seperated by a single space...I want to convert those spaces into returns...This is how it looks:
[/URL] [URL=
I want to put a return where that space is inbetween the two of them...Do I need to include more text before and after each point to make it work..?
AYHJA
You could replace all spaces with \n, but this will replace all spaces in the entire file, so that may not be what you want.
Instead you could do this:
HTH, Berend
Instead you could do this:
Code: Select all
Search: \] \[ <== Note the space after ]
Replace: ]\n[
Merging 2 text files
I had to do it in the past, the easiest -I found- was to read both files, second being the second dimension of an array you populated with the first file's lines.
You just create a file from the resulting array ...
You just create a file from the resulting array ...
Charles
http://www.charleswebdesign.com/
http://www.charleswebdesign.com/