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
visual-studio
ionic2
spring-data
android-espresso
magento2
svn
activex
mousemove
hid
azure-mobile-services
kurento
azure-logic-apps
reportviewer
driver
rangy
jquery-select2-4
angular4
pushdown-automaton
dma
playframework-2.0
cocos2d-android
maven-surefire-plugin
sybase-ase
ava
perfino
web-push
beego
clipboard
openbravo
oracleforms
dnsmasq
snap-framework
image-optimization
winrm
nppexec
des
subclassing
formsauthenticationticket
cordys-opentext
jade4j
selenide
sbjson
newtons-method
apache-toree
type-inference
ssi
roracle
image-registration
sony-future-lab-n
nothing
cordova-ios
iptv
punctuation
word-2007
kendo-treeview
front-camera
google-shopping-api
d3v4
cocoa-bindings
portal
e
livecycle
dmarc
raw-sockets
between
qtcpsocket
maven-release-plugin
piping
jeasyui
android-async-http
trust
wif4.5
arbre
lowercase
nastran
pythonxy
sqlbase
espresso
phpredis
flow-js
scala-macros
tidyr
ssmtp
uno
adhoc-polymorphism
rubber
cout
nesper
producer
xcode6.3.1
maven-central
code-complexity
pbkdf2
hyphen
jquery-transit
xs
jquery-lazyload
itunes-sdk
multiscaleimage
struts2-json-plugin
wndproc
hardcode
liveconnect
gwt-celltable
mmc3
haiku
downgrade
resharper-5.0
eventaggregator
yahoo-maps
spring-modules
processors
main-method
eai
server-load

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