473,395 Members | 1,969 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,395 software developers and data experts.

Formatting the data

HI i have a file with data

--------------------------------------------------------
DESC: Baseline-Forwarding 2_PIMS_2_ONBOARD_PIC 1518B
DATE: 2007-07-18 03:48:54 ./j2320-baseline-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:144375 mbits:1753.29 wirebits:none min_lat:68.315 max_lat:805.175 avg_lat:482.3568800155
Port Configuration : 2 PIMS and 2 ONBOARD PIC
---------------------------------------------------------
DESC: Baseline-Forwarding 2_PIMS 66B
DATE: 2007-07-18 04:18:56 ./j2320-baseline-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 220000 at 66 packets
pps:242578 mbits:128.081184 wirebits:none min_lat:12.265 max_lat:618.86 avg_lat:120.3188615163
Port Configuration : 2 PIMS
---------------------------------------------------------
DESC: NAT 2_PIMS_2_ONBOARD_PICS 1518B
DATE: 2007-07-18 06:15:09 ./j2320-nat-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:143750 mbits:1745.7 wirebits:none min_lat:73.97 max_lat:917.41 avg_lat:500.197639877
Port Configuration : 2 PIMS and 2 ONBOARD PICs
---------------------------------------------------------
DESC: NAT 2_PIMS 66B
DATE: 2007-07-18 06:53:33 ./j2320-nat-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 80000 at 66 packets
pps:84687 mbits:44.714736 wirebits:none min_lat:15.82 max_lat:2121.62 avg_lat:144.322113815
Port Configuration : 2 PIMS
---------------------------------------------------------
DESC: SFW 2_PIMS_2_ONBOARD_PICS 1518B
DATE: 2007-07-18 04:54:22 ./j2320-sfw-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:143750 mbits:1745.7 wirebits:none min_lat:73.135 max_lat:630.74 avg_lat:425.249080415
Port Configuration : 2 PIMS and 2 ONBOARD PICS
---------------------------------------------------------
DESC: SFW 2_PIMS 66B
DATE: 2007-07-18 05:33:38 ./j2320-sfw-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 80000 at 66 packets
pps:87187 mbits:46.034736 wirebits:none min_lat:15.78 max_lat:3148.62 avg_lat:143.5830413571
Port Configuration : 2 PIMS
---------------------------------------------------------
DESC: SFW+NAT 2_PIMS_2_ONBOARD_PICS 1518B
DATE: 2007-07-18 07:35:11 ./j2320-sfwnat-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:143750 mbits:1745.7 wirebits:none min_lat:76.775 max_lat:740.6 avg_lat:443.8299334945
Port Configuration : 2 PIMS and 2 ONBOARD PICs
---------------------------------------------------------
DESC: SFW+NAT 2_PIMS 66B
DATE: 2007-07-18 08:15:26 ./j2320-sfwnat-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 75000 at 66 packets
pps:76875 mbits:40.59 wirebits:none min_lat:16.42 max_lat:1571.03 avg_lat:142.17509115465
Port Configuration : 2 PIMS
---------------------------------------------------------


my problem is based on the key version number i.e 8.4 R1 or 8.4 R2 or 8.4 R3 the block of data starting from DESC till '----' dashes is to be sorted.

I want a code in either C or C++ input is above text file o/p should be same text file with sorted data based on version number

Thnaks in Advance
Aug 16 '07 #1
1 1270
gpraghuram
1,275 Expert 1GB
HI i have a file with data

--------------------------------------------------------
DESC: Baseline-Forwarding 2_PIMS_2_ONBOARD_PIC 1518B
DATE: 2007-07-18 03:48:54 ./j2320-baseline-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:144375 mbits:1753.29 wirebits:none min_lat:68.315 max_lat:805.175 avg_lat:482.3568800155
Port Configuration : 2 PIMS and 2 ONBOARD PIC
---------------------------------------------------------
DESC: Baseline-Forwarding 2_PIMS 66B
DATE: 2007-07-18 04:18:56 ./j2320-baseline-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 220000 at 66 packets
pps:242578 mbits:128.081184 wirebits:none min_lat:12.265 max_lat:618.86 avg_lat:120.3188615163
Port Configuration : 2 PIMS
---------------------------------------------------------
DESC: NAT 2_PIMS_2_ONBOARD_PICS 1518B
DATE: 2007-07-18 06:15:09 ./j2320-nat-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:143750 mbits:1745.7 wirebits:none min_lat:73.97 max_lat:917.41 avg_lat:500.197639877
Port Configuration : 2 PIMS and 2 ONBOARD PICs
---------------------------------------------------------
DESC: NAT 2_PIMS 66B
DATE: 2007-07-18 06:53:33 ./j2320-nat-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 80000 at 66 packets
pps:84687 mbits:44.714736 wirebits:none min_lat:15.82 max_lat:2121.62 avg_lat:144.322113815
Port Configuration : 2 PIMS
---------------------------------------------------------
DESC: SFW 2_PIMS_2_ONBOARD_PICS 1518B
DATE: 2007-07-18 04:54:22 ./j2320-sfw-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:143750 mbits:1745.7 wirebits:none min_lat:73.135 max_lat:630.74 avg_lat:425.249080415
Port Configuration : 2 PIMS and 2 ONBOARD PICS
---------------------------------------------------------
DESC: SFW 2_PIMS 66B
DATE: 2007-07-18 05:33:38 ./j2320-sfw-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 80000 at 66 packets
pps:87187 mbits:46.034736 wirebits:none min_lat:15.78 max_lat:3148.62 avg_lat:143.5830413571
Port Configuration : 2 PIMS
---------------------------------------------------------
DESC: SFW+NAT 2_PIMS_2_ONBOARD_PICS 1518B
DATE: 2007-07-18 07:35:11 ./j2320-sfwnat-forwarding-performance-1500B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 70000 at 1518 packets
pps:143750 mbits:1745.7 wirebits:none min_lat:76.775 max_lat:740.6 avg_lat:443.8299334945
Port Configuration : 2 PIMS and 2 ONBOARD PICs
---------------------------------------------------------
DESC: SFW+NAT 2_PIMS 66B
DATE: 2007-07-18 08:15:26 ./j2320-sfwnat-forwarding-performance-48B.pl 8.4R1.3 2007-07-14 00:57:53 UTC DUT sps2320a j2320
Expected PPS 75000 at 66 packets
pps:76875 mbits:40.59 wirebits:none min_lat:16.42 max_lat:1571.03 avg_lat:142.17509115465
Port Configuration : 2 PIMS
---------------------------------------------------------


my problem is based on the key version number i.e 8.4 R1 or 8.4 R2 or 8.4 R3 the block of data starting from DESC till '----' dashes is to be sorted.

I want a code in either C or C++ input is above text file o/p should be same text file with sorted data based on version number

Thnaks in Advance
Hi,
1)First read the file block by block.
2)Then get the value(this is index) for which u want to sort separately(as a string)
3)Then declare a map<string,string>
4)store the whole block in the map with the index u have read in step 2.

Hope this helps.
Aftertrying this if u still face issues, come back here with the problems

Raghuram[/list]
Aug 16 '07 #2

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

Similar topics

4
by: Rob Meade | last post by:
Hi all, Ok - this leads on from speaking to a couple here and in the SQL server group... I've an application which allows the user to type in their text into a form, they add 'happy' tags...
4
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
2
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
2
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
0
by: GGerard | last post by:
Hello With MSAccess 2000, I have created a program with forms and applied some Conditional Formatting on some of the text box.
7
by: L. Scott M. | last post by:
Have a quick simple question: dim x as string x = "1234567890" ------------------------------------------------------- VB 6 dim y as string
14
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
6
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.