Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross-Platform C++ Parser Library

What would a good cross-platform C++ parser for use on a space and tab delimited txt file? I am looking to parse the file and then output a new txt file based off the parsed info.

The input file contains details for a network traffic script with several columns such as Host IP Address, Host Interface, Subnet, etc.

I need to take the information from the input file and create the traffic script in the format that another application requires.

Here is an example of the format for the input file:

Hostname    HostIP Area    Host Interface   Number of Routes
test1    128.1.1.1 0.0.0.0       128.100.1.1       100   
test1    128.1.1.2 0.0.0.0
test1    128.1.1.3 0.0.0.0
test2    128.2.2.4 0.0.0.0       128.200.5.6       100
test2    128.2.2.5 0.0.0.0
test2    128.2.2.6 0.0.0.0

I am asking for a library that would be ideal to parse this type of data and create a new text file.

like image 869
THE DOCTOR Avatar asked Dec 01 '25 14:12

THE DOCTOR


1 Answers

For a simple input file like the example you've give, you could write your own just for this file type. You can use the standard C++ classes and build your own file interpreter. Here's a great guide:

http://www.cplusplus.com/doc/tutorial/files

like image 105
James Bedford Avatar answered Dec 04 '25 04:12

James Bedford



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!