Questions tagged [fileparse]

13 questions
90
votes
13 answers

What is the easiest way to parse an INI File in C++?

I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?
conmulligan
  • 6,849
  • 6
  • 28
  • 44
9
votes
8 answers

Best method of Textfile Parsing in C#?

I want to parse a config file sorta thing, like so: [KEY:Value] [SUBKEY:SubValue] Now I started with a StreamReader, converting lines into character arrays, when I figured there's gotta be a better way. So I ask you, humble reader, to help…
Bernard
  • 43,502
  • 18
  • 52
  • 69
6
votes
4 answers

Design pattern for parsing binary file data and storing in a database

Does anybody recommend a design pattern for taking a binary data file, parsing parts of it into objects and storing the resultant data into a database? I think a similar pattern could be used for taking an XML or tab-delimited file and parse it…
Keith Sirmons
  • 7,863
  • 15
  • 49
  • 74
2
votes
1 answer

perl - File::Basename->fileparse returns "File::Basename"

For some reason my code is doing this wierd thing where fileparse only prints (literally) File::Basename use strict; use warnings 'all'; use File::Basename; ... my $fileName = File::Basename->fileparse($filePath); print("$filePath\n"); …
0xfff0
  • 636
  • 2
  • 9
  • 19
2
votes
4 answers

What would be the best way to parse this file?

I was just wondering if anyone knew of a good way that I could parse the file at the bottom of the post. I have a database setup with the correct tables for each section eg Refferal Table,Caller Table,Location Table. Each table has the same columns…
Nathan W
  • 50,657
  • 24
  • 92
  • 142
1
vote
10 answers

Best Practices for AS3 XML Parsing

I've been having some trouble parsing various types of XML within flash (specifically FeedBurner RSS files and YouTube Data API responses). I'm using a URLLoader to load a XML file, and upon Event.COMPLETE creating a new XML object. 75% of the time…
Jeff Winkworth
  • 4,634
  • 6
  • 31
  • 33
1
vote
2 answers

What is the easiest way to change sections order of INI file in C++

I'm trying to read an INI file and write another INI file with the sections order changed. Does Windows API have tools for this kind of INI file processing? Are there open-source solutions that are preferred? Or should I try to attempt to parse it…
zenpoy
  • 17,674
  • 8
  • 51
  • 84
0
votes
1 answer

Extract list of files lines between pattern in java

I have a file like - -------------- abc efg hig --------------- xyz pqr --------------- fdg gege ger ger --------------- Whats the best way to write java code which parses this file and creates separate List for each of the block of text between…
vivek garg
  • 293
  • 1
  • 2
  • 14
0
votes
0 answers

Encountering IndexError when file parsing with Python

I have a file containing a previous tcpdump, so the file has lines in this format: 17:20:03.867998 IP 23.222.75.204.443 > 192.168.0.15.51773: Flags [.], ack 518, win 916, options [nop,nop,TS val 303057114 ecr 43022775], length 0 17:20:03.870231 IP…
DAT BOI
  • 183
  • 1
  • 1
  • 8
0
votes
3 answers

Easiest way to get a specific section of a file path

I have a bit of a tricky one to solve. I have the need to extract a specific portion of a file path. I've extracted a zip file under a temp directory have have the full path to the file. Essentially what I would like is to get the difference…
user2643864
  • 599
  • 2
  • 9
  • 24
0
votes
1 answer

Perl fileparse Path Name

Here is my situation: use strict; use Cwd; use Getopt::Long; Getopt::Long::Configure('pass_through'); use File::Spec; use File::Basename; 1) -out=/some/place/some_filename.txt 2) -out=/some/place/ 3) -out=some_filename.txt Any user can give any…
Rod
  • 41
  • 4
0
votes
3 answers

Parsing File details for Windows FTP Server

I am trying to connect to FTP server through the c# code and I am getting the list of Files and directories. And that I am saving in a ArrayList(with all attributes). I can find the FTP Server type through the SYS ftp command. I have a regular…
marshalprince
  • 95
  • 4
  • 11
-1
votes
1 answer

How to match phone number prefixes?

I am analyzing data with phone numbers which I need to match to the country and the operator. I have received the country and destination (city/operator) mappings of the phone numbers prefixes in the following form: Country, Destination, Country…
sfactor
  • 10,810
  • 30
  • 92
  • 146