Convert Line Break Into Comma?

lewi

Elite Member
Joined
Aug 5, 2008
Messages
2,404
Reaction score
893
Hey,

Have a huge keyword list of like 20,000 words and need to convert them into keyword1,keyword2,keyword3 etc format

Currently they look like this...

keyword1
keyword2
keyword3

Now had a bot made for me but it keeps stalling even with 4gb ram and 6ghz server and that is only with like 1/8th of the list (takes a while to cut it down smaller and will take even longer to put it all back together).

So anyone got any ideas?

I tried notepad find and replace as that is quick but cannot turn a line break into a comma unfortunately (or can you?)

Thanks

Lewi
 
Have you tried excel?

I have only tried notepad and pasting them into this bot this guy made for me!

Even notepad takes like 5 minutes to load it up so excel will probably take a lot longer and crash!

But how would you do it with excel?

Lewi
 
check out this thread:
Code:
http://www.blackhatworld.com/blackhat-seo/white-hat-seo/153028-how-convert-carriage-return-comma-separated-keyword-list.html
or this:
Code:
http://www.blackhatworld.com/blackhat-seo/black-hat-seo/197421-convert-row-into-comma-separated-list.html
 
I have only tried notepad and pasting them into this bot this guy made for me!

Even notepad takes like 5 minutes to load it up so excel will probably take a lot longer and crash!

But how would you do it with excel?

Lewi
In excel it is pretty easy to convert column to rows. You highlight the values and then copy.

Right click and choose paste special.

Make sure you tick Transpose.

That's it.

After that you just save it in whatever file format that you want.
 
Looks like you are on windows. If you have a linux machine, it's trivial:

Code:
tr '\n' , < infile > outfile

Where 'infile' is your file with the newlines and outfile is the file with the commas in place of newlines.

If your file was created on windows, it actually contains both a newline and a carriage return. If you need to drop the carriage return in addition to the substitution:

Code:
tr '\n' , < infile | tr -d '\r' > outfile

Note that the resulting file will only have a single line in it. This may or may not be what you want. If you have thousands of keywords, it probably isn't. It's easy to fix, but no point in showing you how unless you can't use just the single line.
 
I had the same problem with something similar, but it's the same solution.

Open the file in microsoft words. press ctr+h, then find: "^p" & replace by: ","
 
Last edited:
okay here is a little php script which i wrote for you , this might help.

Code:
<?php
set_time_limit(0);
$myfile = 'your txt file name';//place this txt file in same directory as the php code.
$lines = file($myfile);   
for($i=count($lines);$i>0;$i--)
//for($i=100;$i>0;$i--) //if you need to get first 100 words
{
    echo "$lines[$i],";    
}

?>
Hit thanks if you find this helpful.
 
cannot turn a line break into a comma

Download Textpad. It's free. It is a text editor like notepad, but it also has regular expressions like Linux. After pasting in your data, select Replace under the Search Tab, check Regular Expression in the box, and put \n in the Find What field (\n is the regular expression for line break) and put , in the Replace with field, hit Replace All and you are done.

Textpad is very useful and I use it all the time.
 
Back
Top