generate CSV file and what is different for use #include "csv-reader.h" to generate not read ?

58 views
Skip to first unread message

ABDULJABBAR ALSHARIF

unread,
Sep 12, 2023, 5:24:16 AM9/12/23
to ns-3-...@googlegroups.com
 
hi all this true ? i run it it gets error Tom if you are available just check out ...

 // Create a CSV file to store the QoS metrics
  CsvFileHelper csvFileHelper;
  csvFileHelper.ConfigureFormat ("Time", "Jitter");
  Ptr<CsvFile> csvFile = csvFileHelper.CreateFile ("qos_metrics.csv");

  // Iterate through flows and record jitter data to the CSV file
  FlowMonitor::FlowStatsContainer stats = monitor->GetFlowStats ();
  for (FlowMonitor::FlowStatsIterator it = stats.begin (); it != stats.end (); ++it) {
    double jitter = it->second.jitterSum.GetSeconds () / it->second.rxPackets;
    csvFile->AddRow (it->second.timeLastRxPacket.GetSeconds (), jitter);
  }

  // Save the CSV file
  csvFile->Close ();

  // Read data from a CSV file (add your CSV reading logic)
  CsvReader csvReader ("your_data.csv");

" if you want the rainbow you have deal with rains"



Tommaso Pecorella

unread,
Sep 12, 2023, 12:40:26 PM9/12/23
to ns-3-users
CsvFileHelper is not a class provided by ns-3. There's a "CsvReader" but it only read CSV files.

I do understand that you're in a rush, you have no experience in coding, and you don't want to learn it either - but we (me or other people) can't code for you.
Please take your time to look at the documentation and learn the code.

About writing a CSV file, you don't need a helper. A CSV file is a... comma separated value file, so write the data separated by a comma - it's not that hard.

ABDULJABBAR ALSHARIF

unread,
Sep 12, 2023, 12:54:36 PM9/12/23
to ns-3-...@googlegroups.com
okay, but it doesn't work get an error this way by letting the write-to-text file not work I used to generate ASCII files before but i forgot it would work.

" if you want the rainbow you have deal with rains"



--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/b286757a-3858-49a4-8dc3-01a76b9eb0den%40googlegroups.com.

Tommaso Pecorella

unread,
Sep 12, 2023, 3:23:21 PM9/12/23
to ns-3-users
Reply all
Reply to author
Forward
0 new messages