473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

i need help to tokenize the string taken from the file

My input file is like
:the directory is :/opt/ericsson/nms_eam_eac/UIhelp:
37K
60K
29K
59K
35K
137K

:the directory is :/opt/ericsson/nms_eam_eac/bin:

1.0M
728
11111K
125K
21K
2.7M
550
129K
69K
491K
37K
60K
29K
59K
35K
137K
1.1K
3.7K
4.9K
1.1K
2.5K
2.0K
1.0M
1.0M
:the directory is :/opt/ericsson/nms_eam_eac/dat:
the output should be the sum of size of the file given below in MB . corresponding to the directory name.
Example
the directory is :/opt/ericsson/nms_eam_eac/UIhelp:
Size=14M
:the directory is :/opt/ericsson/nms_eam_eac/bin:
size =14.8M
....

i have tried but not able to get the output.
please help me.
May 23 '12 #1
1 1218
weaknessforcats
9,208 Expert Mod 8TB
Maybe you could post some of yur code.
May 23 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Allan Bruce | last post by:
I want to load config from a file. I know how to load in numbers using an ifstream, but I cant get it to load a string. Can somebody tell me how to load a string from file? Here is my code: ...
9
by: Sharon | last post by:
hi, I want to extract a string from a file, if the file is like this: 1 This is the string 2 3 4 how could I extract the string, starting from the 10th position (i.e. "T") and...
7
by: Dan H. | last post by:
Hello, What is the equivalent "string resource file" in c#? And, is there a way to create a beep in C#? Thanks, Dan
2
by: Daniel | last post by:
Is there any way for System.IO.StreamWriter Write method to write out part of the string to file. such as if the machine is shut down half way through? or does the file not actually exist until the...
20
by: bubunia2000 | last post by:
Hi all, I heard that strtok is not thread safe. So I want to write a sample program which will tokenize string without using strtok. Can I get a sample source code for the same. For exp:...
15
by: Gan Quan | last post by:
I'm writing a c++ program that has many (100+) threads read/write files simultaneously. It works well if not considering the efficiency. The file i/o seems to be the bottleneck. This is my code...
0
by: mimi | last post by:
#include <fstream> #include "stdio.h" int main() { // std::wofstream strm2("test.txt"); // strm2 << L"ÎÒ°®±±¾©Ìì°²ÃÅ"; FILE *hFile = fopen("test.txt", "wb+"); wchar_t *buffer =...
2
by: =?Utf-8?B?S3VtYXI=?= | last post by:
I am using granados telnet client for connecting to the telnet and get the data from it. Every thing appears to be going smooth. But for some reason when I try to write the byte data to a string or...
2
by: mahmoodn | last post by:
I want to pass a string as file name to a ifstream object, but I can't. char cnt_string = ""; string f = "ss_"; int cnt = 1; string seq = itoa(cnt, cnt_string, 10); string file = f+seq+".txt";...
1
by: star01daisy | last post by:
This is what i have, but when i run the program the only thing that comes out is the inro line "This program opens...". What do i have to do for it to run smoothly.The program is supposed to sort the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.