Questions tagged [text-processing]

Mechanizing the creation or manipulation of electronic text.

Text processing includes basic processing jobs using filter, tokenization or normalization method to process text. This could be a pre-processing step for .

See also:

1959 questions
0
votes
2 answers

html select option into a list

Is there any way I could select all the
DGT
  • 2,604
  • 13
  • 41
  • 60
0
votes
1 answer

Python string to list for editing

I'm trying to do some text processing that's mostly re.sub() commands. I know I can't alter a string, but even after I try converting the string to a list and changing it element by element, there's still no change in the output. What I want to know…
bkula
  • 541
  • 3
  • 10
  • 22
0
votes
2 answers

Append to certain line of file with awk, leaving non-matching lines unchanged

given file test and its content: bcd://dfl sf I would like to append extra information to the line having certain content (starting with bcd) While the following script works awk '/bcd*/ {print $0", extra information"} ' test > test.old && mv…
rok
  • 9,403
  • 17
  • 70
  • 126
0
votes
0 answers

Merge 2 Files and Sort with Headers into a 3rd

I'm trying to take the 2 files below, and create a script to sort them into a new file of 3 column's with headers and some additional info. I know the command to combine files and sort -- cat file1 file2 | sort > file3 but I don't know how to align…
Ari
  • 1
0
votes
0 answers

Execute sed command on remote device using python's telnetlib

I have a remote device where telnetd daemon is running. I would like to execute a few sed commands to update the /etc/securetty file and add pts/0, pts/1...pts/n to this file on this device through a telnet connection. I wrote the following python…
skrowten_hermit
  • 437
  • 3
  • 11
  • 28
0
votes
1 answer

Which package/function do I use to replace entries containing a certain set of letters with a 0 or 1?

Sorry if it's a dumb question, but I'm not sure what keywords to use to find the answer so nothing I get is quite what I'm looking for. I have a column: df$infecting_agent. The entries there are things like "staphylococcus" "bacteria" "virus"…
CineyApp
  • 19
  • 3
0
votes
4 answers

Are there text processing function that operate on word level in R?

I am trying to find a group of functions in R that would operate on word level. e.g. a function that could return the position of the word. For example given the following sentence and query sentence <- "A sample sentence for demo" query <-…
Imran Ali
  • 2,223
  • 2
  • 28
  • 41
0
votes
3 answers

Replacing/Inserting a line to the end of a file

I'm trying to create a script which inserts a line at the end of a file. But if I call the script multiple times It shouldn't create the same entry multiple times in the file. So If I'm inserting the file on the 21st line, which I know is the end…
Gopikrishnan R
  • 11
  • 1
  • 1
  • 4
0
votes
1 answer

Impossible to see results of `RTextTools::toLower()` text in Document-Term-Matrix

I try to create a matrix, for this I would like to tolower text. For this I use this R instruction : matrix = create_matrix(tweets[,1], toLower = TRUE, language="english", removeStopwords=FALSE, removeNumbers=TRUE, …
Datackatlon
  • 199
  • 1
  • 4
  • 15
0
votes
1 answer

How top reorganize geo JSON file

I have a geoJSON file which is in the format { "type": "Feature", "id":"01", "properties": { "name": "AREA" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ …
user7477092
0
votes
2 answers

String meaning comparison

Is there some sort of algorithm out there or concept that can help with the following problem? Say I have two snippets of text, snippet 1, and snippet two. Snippet 1 reads as follows: "The dog was too scared to go out into the storm" Snippet 2…
ddeamaral
  • 1,403
  • 2
  • 28
  • 43
0
votes
1 answer

How to use the head() function in R for multiple dataframes?

How can I use the head() function for multiple files at the same time? The following script does not work. head(c(mtcars, airquality)) $mpg [1] 21.0 21.0 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 17.8 16.4 17.3 15.2 10.4 10.4 [17] 14.7 32.4 30.4…
Daniel
  • 1,202
  • 2
  • 16
  • 25
0
votes
1 answer

swap 128 bytes hex to another order

I have this work perl can support 4 hex numbers to swap in another 4 hex perl -wMstrict -le ' my @bits = unpack "(A1)16", sprintf "%016b", hex shift; my $bitmap = "D5679123C4EF80AB"; @bits = @bits[ map { hex } split //, $bitmap ]; …
0
votes
1 answer

loop control to break from current if loop

I am trying loop control. while loop then a for loop and inside it there are couple of if loops, if 3 of the if loop satisfies it should exit the for loop to continue with while loop else it should exit the if loop to continue rest of for loop…
Sid
  • 161
  • 1
  • 10
0
votes
1 answer

String Processing with loop VB.net

While i < n array(i) = New System.Drawing.Point(points(i).X, points(i).Y) res = (array(i).ToString) Debug.Print("Res: " & res) i += 1 End While This is the code I have... My output is- Res:…
nsssayom
  • 364
  • 1
  • 5
  • 21
1 2 3
99
100