Questions tagged [fileparsing]

170 questions
16
votes
11 answers

What language is to binary, as Perl is to text?

I am looking for a scripting (or higher level programming) language (or e.g. modules for Python or similar languages) for effortlessly analyzing and manipulating binary data in files (e.g. core dumps), much like Perl allows manipulating text files…
Eric Hansander
  • 944
  • 2
  • 11
  • 20
9
votes
4 answers

Fastest way to skip lines while parsing files in Ruby?

I tried searching for this, but couldn't find much. It seems like something that's probably been asked before (many times?), so I apologize if that's the case. I was wondering what the fastest way to parse certain parts of a file in Ruby would be.…
DRobinson
  • 4,441
  • 22
  • 31
8
votes
3 answers

Parse Uploaded CSV file using D3.js

I'm new to d3.js so I know this might seem as a silly question to some so please bear with me. I'm trying to parse a csv file which a user uploads and print it's output in the console. I'm able to parse the CSV file when I provide the absolute path…
Lucy
  • 1,812
  • 15
  • 55
  • 93
7
votes
6 answers

Generating data structures by parsing plain text files

I wrote a file parser for a game I'm writing to make it easy for myself to change various aspects of the game (things like the character/stage/collision data). For example, I might have a character class like this: class Character { public: int…
Alex
  • 14,973
  • 13
  • 59
  • 94
6
votes
2 answers

Parsing, Aggregating & Sorting text file in Python

I have the file named "names.txt" having the following contents: {"1":[1988, "Anil 4"], "2":[2000, "Chris 4"], "3":[1988, "Rahul 1"], "4":[2001, "Kechit 3"], "5":[2000, "Phil 3"], "6":[2001, "Ravi 4"], "7":[1988, "Ramu 3"], "8":[1988, "Raheem 5"],…
Jayu
  • 189
  • 1
  • 1
  • 8
6
votes
2 answers

xlrd cannot read xlsx file downloaded from email attachment

This is a very very strange issue. I have quite a large excel file (the contents of which I cannot discuss as it is sensitive data) that is a .xlsx and IS a valid excel file. When I download it from my email and save it on my desktop and try to…
user2654569
  • 957
  • 6
  • 10
4
votes
2 answers

Is there a list of Ruby File Parsing questions/puzzles

I came across this File parsing programming challenge today and found it quite interesting. I also went for an interview about 6ish months back where also I was given a txt file which had to be parsed with logic to get the desired results. I want…
Omnipresent
  • 29,434
  • 47
  • 142
  • 186
4
votes
2 answers

Print a number of previous lines after matching string found in line in python

I'm writing a program to parse through some log files. If an error code is in the line, I need to print the previous 25 lines for analysis. I'd like to be able to repeat this concept with more or less lines depending on the individual error code…
pjano1
  • 143
  • 1
  • 3
  • 10
4
votes
2 answers

Parse Whatsapp Log-File in Java

I´m currently working on a little tool which analyses the usage of a group-chat in Whatsapp. i´m trying to realize it with the whatsapp logfile. I managed it to format the raw .txt to the following format to work with the formated text: 29. Jan.…
4
votes
2 answers

Whats is the behaviour of the "wc" command?

For example: myCleanVar=$( wc -l < myFile ) myDirtVar=$( wc -l myFile ) echo $myCleanVar 9 echo $myDirtVar 9 myFile why in "myCleanVar" I get an "integer" value from the "wc" command and in "myDirtVar" I get something like as: "9 file.txt"? I…
shogitai
  • 1,823
  • 1
  • 23
  • 50
3
votes
5 answers

Simple data storing in Python

I'm looking for a simple solution using Python to store data as a flat file, such that each line is a string representation of an array that can be easily parsed. I'm sure python has library for doing such a task easily but so far all the approaches…
KeyboardInterrupt
  • 3,483
  • 8
  • 36
  • 41
3
votes
6 answers

How to read a file in python which has newline and tabs into a string?

I am trying to read a file which has tabs and newline etc and the data is JSON format. When I read it using file.read()/readlines() etc, all the newlines and tabs are also read. I have tried rstrip(), split etc but in vain, maybe I am missing some…
ara
  • 39
  • 1
  • 3
3
votes
6 answers

Check for unique line data from file with 5 millions lines in Java

I have big file with row like ID|VALUE in one pass. In case of ID repeat, line must be ignored. How to effectively make this checking? added: ID is long(8 bytes). I need a solution that uses minimum of memory. Thank's for help guys. I was able to…
Sarge
  • 79
  • 6
3
votes
2 answers

how to read, parse the SBM file format from Superbible Opengl

Calling on experts, gurus, and anybody to help read and parse a file in python. On page 751 of 6th ed. or page 800 of 7th ed. of Superbible OpenGL there is Appendix B. The SBM File Format that seems to explain well the format to some extent. I have…
Stan S.
  • 237
  • 7
  • 22
3
votes
1 answer

.obj to raw vertices converter with normals in python

Iam asking for your help again. I want to make a script with python that takes an .obj format file of vertices and normals and exports 2 files with the vertex coordinates and another with the normal coordinates of the normal v 1.900470 2.777519…
Thodoris Koutsis
  • 109
  • 1
  • 12
1
2 3
11 12