Questions tagged [fileparsing]
170 questions
2
votes
0 answers
File formats for Stars! by Mare Crisium
There is an old strategy came called Stars! by Mare Crisium.
I would like to write some AI to play this game, but I don't get much fun out of trying to decipher file formats.
Does anyone know the format of the X and H files that are used for turns? …

Jacob Brewer
- 2,574
- 1
- 22
- 25
2
votes
2 answers
In Ruby- Parsing Directory and reading first row of the file
Below is the piece of code that is supposed read the directory and for each file entry prints the first row of the file. The issue is x is not visible so file is not being parsed.
Dir.foreach("C:/fileload/src") do |file_name|
x = file_name
puts…

nprs
- 93
- 1
- 6
2
votes
2 answers
How to Build a dictionary from a text file in Python
I have a text file with entries that look like this :
JohnDoe
Assignment 9
Reading: NO
header: NO
HW: NO
Solutions: 0
show: NO
Journals: NO
free: NO
Finished: NO
Quiz: 0
Done
Assignment 3
E-book: NO
HW: NO
Readings: NO…

Joe
- 512
- 1
- 3
- 16
1
vote
7 answers
File Parsing in C#
I am building a game in Visual Studio 2008 and in order to build levels, i will have two types of files (more than that actually but these two are the only ones important to my question) i need to parse. One will dictate the contents of a level and…

RCIX
- 38,647
- 50
- 150
- 207
1
vote
2 answers
Best (quickest) way to parse and modify a file
Recently I have been using alot of text files (csv) with 10-60k lines, something like this
id1,id2
id3,id1
id81,id13
...
And most of the times, I need to extract this informaton in form of an array:
id1,id2,id3,id1,id81,id13
Or at times,…

zengr
- 38,346
- 37
- 130
- 192
1
vote
1 answer
How to parse a Really Big Incorrectly Saved JSON file to fix it
I was working across a big dataset of approximately a million items and took a dump from a database using streams. However, I mistakenly missed the opening and closing box brackets to indicate a json array and just pushed the objects without it.
Now…

MehulB
- 13
- 3
1
vote
1 answer
Parse .msg outlook file with flutter/dart
I need help running this python code in a windows flutter app
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
msg = outlook.OpenSharedItem(r"C:\test_msg.msg")
using the win32 package, as I can't…

BananaMaster
- 377
- 6
- 15
1
vote
1 answer
powershell cant get json key / value
Hello I have a json file below:
{
"supports": {},
"dependencies": {
"AST.NxTestware.main": "1.1.0",
"otherPackagenName": "7.7.7"
},
"frameworks": {
".NETPortable,Version=v4.5,Profile=Profile78": {}
}
}
and I am trying to write…

POVR2
- 87
- 10
1
vote
1 answer
how to seperate a csv file using commas if it has null values and we need data corresponding to upper column?
My code is
BufferedReader fileReader = new BufferedReader(new FileReader(strFileName));
while ((strLine = fileReader.readLine()) != null) {
// [2011.06.28] based on OAP's mail, now ignore "quotations"
…

Mudit Jha
- 11
- 2
1
vote
1 answer
Get values from variable contents using PowerShell for code parsing
I have parsed the content of an API call to a variable $a.(Content below) and I would like to only parse out the list of packages which are under "dependencies". Is there are way to filter for only the dependencies using powershell?.
{
"name":…

Caleb Adepoju
- 115
- 8
1
vote
2 answers
Read a file in python from one particular word to another and put it in a list
So let's say i'm reading a txt file in Python which is something like this:
..
Keywords- key1; key2, key3; key4
Abstract ..
..
Now i want to parse the file until i find the word "Keywords", and then put all the keywords into a list,
so the list…

mihika
- 11
- 1
1
vote
3 answers
Parse only selected records from empty-line separated file
I have a file with the following structure:
SE|text|Baz
SE|entity|Bla
SE|relation|Bla
SE|relation|Foo
SE|text|Bla
SE|entity|Foo
SE|text|Zoo
SE|relation|Bla
SE|relation|Baz
Records (i.e., blocks) are separated by an empty line. Each line in a…

Andrej
- 3,719
- 11
- 44
- 73
1
vote
1 answer
How I can skip a blank line in an input file when using strtok?
I want to pass lines of a file using strtok; the values are comma separated. However, strtok also reads blank lines which only contain spaces. Isn't it suppose to return a null pointer in such a situation?
How can I ignore such a line? I tried to…

drox
- 7,523
- 4
- 23
- 34
1
vote
1 answer
How to use the biblib parser with a bibtex file stored in a pyhon variable?
I have a bibtex file that I get from the frontend and I'm trying to parse this file with biblib (a python library to parse bibtex files). Because I get the file from the frontend its not stored in a file on my computer. The file gets passed through…

Lennart
- 67
- 1
- 10
1
vote
0 answers
Effective way to split character from lines of files in java 8
I am looking for effective way to split string/char from huge files line by line.
The split pattern is same for all line. Goal is to read line by line and parse the line then save in objects.
For ex, line in file is
This is a sample for line 1.
Here…

Rahul Verma
- 41
- 2