Questions tagged [fileparsing]
170 questions
1
vote
2 answers
What is the easiest way to parse an INI File in C?
There are some similar questions about C++, Java and C# so now my question is about C. If I have this config…

dali1985
- 3,263
- 13
- 49
- 68
1
vote
3 answers
Parse any file type as XML
I have the following code snippet in a Gradle script (the syntax is a combination of Groovy/Java):
File file = new File(filename) // Filename is being read from console
def content = file.getText()
Document document = DOMBuilder.parse(new…

Pieter VDE
- 2,195
- 4
- 25
- 44
1
vote
2 answers
How to parse file with PHP
I have this file, I cant figure out how to parse this file.
type = 10
version = 1.2
PART
{
part = foobie
partName = foobie
EVENTS
{
MakeReference
{
active = True
}
}
ACTIONS
{
…

Martin-
- 876
- 2
- 13
- 30
1
vote
3 answers
Bash- parse file into arrays
i have this file
Seq1
10 1 5
10 2 6
10 3 9
Seq2
15 2 7
15 4 9
15 8 12
i want to have arrays for each Seqs (Seq1, Seq2) like this:
2ndColumn=(1,2,3)
3rdColumn=(5,6,9)
i wrote this but it does not break the while…

teutara
- 605
- 4
- 12
- 24
1
vote
2 answers
How to take in digits 0-255 from a file with no delimeters
I have a plaintext file that has only numerical digits in it (no spaces, commas, newlines, etc.) which contains n digits which range from 0 to 255. I want to take it in and store these values in an array.
Example
Let's say we have this sequence in…

Ky -
- 30,724
- 51
- 192
- 308
1
vote
1 answer
Docx content and formatting extraction in python
I am trying to parse a docx folder and take specific elements base on wether or not a certain word is bolded. If this is the text in the document:
Foo: Hello
Boo:
Blah Blah
•Blah
•Blah
Choo: Hello
I would want to scan, line by line, and take all…

Matt
- 641
- 1
- 7
- 10
1
vote
4 answers
Most efficient way to parse a file in Python
I want to know what the most efficient way is to parse a text file.
For example, lets say I have the following text file:
Number of connections server is: 1
Server status is: ACTIVE
Number of connections to server is: 4
Server status is:…

madu
- 5,232
- 14
- 56
- 96
1
vote
5 answers
Script to Parse and Change Numbers
I am working with numbers a lot when editing a particular type of file, and it's mostly tedious work. The file has a format like this:
damagebase = 8.834
"abc_foo.odf" 3.77
"def_bar.odf" 3.77
"ghi_baz.odf" 3.77
"jkl_blah.odf" 4.05
…

RCIX
- 38,647
- 50
- 150
- 207
0
votes
0 answers
On malformed files
Suppose you start looking at an XML file, which you parse and confirm that it in fact an XML file. Life is good.
Then someone removes a > somewhere in a file, which effectively makes the file a malformed XML from parser's stand point. As far as it's…

James Raitsev
- 92,517
- 154
- 335
- 470
0
votes
2 answers
Which method to use in searching for a line in a file
I have a file with path names to files:
/my/path1
/my/path11
/my/path12
/my/path13
The file structure is that it has individual paths in each line. All I want to do is search for the existence of a string /my/path1 or anyother in the above file…

footy
- 5,803
- 13
- 48
- 96
0
votes
1 answer
Extract file string data within a time range pattern
I am trying to extract the data within a specific range of time from an input log file.
The input file, has the following pattern:
2023-01-31 00:00:21.354 FINE AS2SenderModule: Message sent and response received in 438 millisecondsms
2023-01-31…

Sheikh_Sheharyar
- 3
- 5
0
votes
0 answers
Breaking large dbf files into smaller chunks
We have already DBF files in our project and we have to parse them and store them as parquet files.
we are reading the files using dbfread module.
smaller files are getting read easily.however,there are some files which are around 1 GB. when we read…

Saravana Kumar
- 55
- 1
- 5
0
votes
0 answers
How to parse and edit XML in TypeScript without converting to JSON
I need to repair an XML file in TypeScript and I cannot find any info on it, since everyone who posts something like this has different needs. I'd like to be pointed in the right direction here.
I have an XML request as shown below. It is…

chxpel
- 141
- 2
- 13
0
votes
0 answers
Using requestretry to call a REST api which responses with xlsx file. I want to read the file without saving it
const xlsx = require("xlsx");
const requestretry = require("requestretry");
let response = await requestretry({
url: "https://dummy.com/filename",
json: false,
headers: { Authorization: token },
maxAttempts: 5,
…

Vishal Gupta
- 21
- 4
0
votes
1 answer
Avoiding duplicate vertices in .obj loader
I have tried for like a week to find a suitable hash function to avoid duplicate vertices on from the .obj files with no success. I have no idea how to loop though the struct (see source code) and get the correct index to index an unordered map. I…

Filiplundbeerg
- 1
- 1