Top "Text-processing" questions

Mechanizing the creation or manipulation of electronic text.

shell replace cr\lf by comma

I have input.txt 1 2 3 4 5 I need to get such output.txt 1,2,3,4,5 How to do it?

bash shell newline text-processing
How to obtain the first letter in a Bash variable?

I have a Bash variable, $word, which is sometimes a word or sentence, e.g.: word="tiger" Or: word="This …

bash text-processing variable-expansion
BufferedReader: read multiple lines into a single string

I'm reading numbers from a txt file using BufferedReader for analysis. The way I'm going about this now is- reading …

java text-processing bufferedreader
How to add double quotes to a line with SED or AWK?

I have the following list of words: name,id,3 I need to have it double quoted like this: "name,id,3" …

regex shell awk sed text-processing
Output text file with line breaks in PHP

I'm trying to open a text file and output its contents with the code below. The text file includes line …

php html text-processing
paste text with a newline/return in formatted text

I want to do a column that is formatted to use for a mailing address and I can not get …

r text text-processing
How do I convert multi line text into one line?

I'm trying to make a txt file with a generated key into 1 line. example: <----- key start -----> …

bash sed text-processing
How to get bag of words from textual data?

I am working on prediction problem using a large textual dataset. I am implementing Bag of Words Model. What should …

python machine-learning text-processing
Remove first directory components from path of file

I need to remove one directory (the leftmost) from variables in Bash. I found ways how can I remove all …

bash shell text-processing
Text processing - Python vs Perl performance

Here is my Perl and Python script to do some simple text processing from about 21 log files, each about 300 KB …

python regex performance perl text-processing