counting


Counting the number of occurrences of C in each line and outputting this number plus the total number of characters in that line


I'm new to programming and having some trouble in actually trying to find out what I need to do in the first place. Any help would be fantastic.
The problem:
I have several files in which I need to count how many "C"s there are in a given line and then need this printed out so that I have #ofC's and total number of characters. There are several million lines of this that needs to be analysed in each file. The data is grouped into four lines, with only the second line containing the data I need.
Example from file:
#M00859:19:000000000-A60W6:1:1101:17503:1628 1:N:0:1
TTATGTATTAAAATTAAGTTTTTTATAAAGTTATTTATTTTGGTTTGATTGGAACGACGAAGAAGTTGTTATATTTTTAAATTGGGAAATTGGAATTATTTGATTAGAAAGTGGGATAATTTTTTTATTTTAATTTTTATTAGATTTATTTAAGTTTTTGGTGTTTTTATAATTTTTTATGTATTTAAATTAAGTTTTTTATGAAGTGATTTAT
+
GGBGBGFHHG3A1DGDEDHGHHGGAG22FBGGFGHHFHHHHG?GGH?FGHB0DGHFCG???//CCHGFHHEGEHHHHHECBGGG1?EFGGH1EF1GHBHFGBFDHEB1GBED11//GB1FFGHHGGHHHHHB1FHFHHEHHE11GHHHHHHFFFHHHHG?CHGHGHHGHHFBHHHHHGHGGHFHHHHBFHHHHEHHHHGGGGFGFBFBFFGGGG
The final aim is to create a scatter plot of the number of C's versus the total number of characters for each file so we can compare the results between files.
Any help would be fantastic!
Cheers,
Justin

Related Links

How to answer queries of type l,r,k which finds number of elements in an array in range l to r which occurs atleast k times?
Dafny and counting of occurences
Counting the number of capital letters in each row in [R]
python: count values of dictionary
How to apply hyperloglog to a timeseries stream
Counting the number of occurrences of C in each line and outputting this number plus the total number of characters in that line
Digit Counting Issue in C++ Program
Binary Strings of the form *111*

Categories

HOME
ionic2
knockout.js
opencart
verification
bokeh
systemd
dry
plpgsql
iverilog
jersey-2.0
mathematical-optimization
apache-kafka-connect
azure-data-lake
visualforce
impala
telegraf
cisco
selection
xamarin-zebble
fireloop
phpstorm-2017.1
android-externalstorage
dhcp
supervisord
boomi
significance
pfobject
spyder
libgit2
bosun
kamailio
connection-refused
ipa
list-comprehension
android-cardview
echosign
tf-idf
gravity-forms-plugin
commonsware-cwac
knights-tour
adminer
xerces-c
busboy
stackpanel
love2d
aurelia-cli
variable-variables
telephonymanager
assemblies
slideshow
spooler
type-inference
flume-twitter
deployd
image-registration
sony-future-lab-n
nusoap
kendo-editor
msxml
google-identity-toolkit
msg
xmlbeans
ndk-build
livereload
nsrunloop
android-4.2-jelly-bean
piping
adp
strpos
i2b2
django-validation
cortana
lovefield
cryptojs
miniconda
msgpack
srv-record
gql
ngcordova
embeddedwebserver
ampersand
com0com
whitespace-language
python-c-extension
nsmutabledata
mod-auth-openidc
n-tier-architecture
multivariate-testing
tabris
commenting
pre
nosql-aggregation
proxy-server
yii-booster
iirf
ui-design
cyrillic
user-forums
linkbutton
xalan
wndproc
server-name
wiktionary
mvcrecaptcha
office-automation
nosetests
uipasteboard
mediacontroller
grails-validation
mygeneration
outlook-2007-addin
odac
asdoc
accumulator
service-factory

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App