Skip to content

Tag: string

Counting word frequency in a sentence

I have two columns – one with sentences and the other with single words. Sentence word “Such a day! It’s a beautiful day out there” “beautiful” “Such a day! It’s a beautiful day out there” “day” “I am sad by the sad weather” “…

Split a string from a textfile correctly

i have a file (“text.txt”) with several lines (~5000000 lines). I’m trying to split a line so that: becomes this two lines: so essentially i want to transform a single line into two lines and write it back to another file. All the lines that has to be split starts with the character “&…