Questions tagged [file-processing]
333 questions
0
votes
2 answers
Replacing String placeholders with different characters
I'm in an intro cse class using Java and I have a new homework where I create a Mad Lib game using File Processing.
I am wondering what the best approach is to replace a String placeholder with an adjective like "cool"
Here is a small portion of my…

Strategiger
- 55
- 9
0
votes
1 answer
How to process continuously updating file from start of fail? .
1 How to process from start of a continuously updating file( 1 --> infinite) ?
2 tail -f / tail -n10 -f solution is not correct, because it processing the file from end or some n lines form end of file. But i need to process the file from start of…
0
votes
1 answer
Run - Time Check Failure #2 in C File processing
Run-Time Check Failure #2 - Stack around the variable 'filename' was corrupted.
My code works whenever I try to process the first memory location.
I can process the .txt file correctly, and I can print it.
Nevertheless, when I ask for a second…

Miguel Tovar
- 11
- 4
0
votes
1 answer
Line/Token based processing (java)
I'm writing a program to read data from files with various sports statistics. Each line has information about a particular game, in say, basketball. If a particular line contains an "@" symbol, it means that one of the teams is playing at home. I'm…

Hector
- 51
- 7
0
votes
0 answers
Efficient way to group data in a large file using Java
Consider a file of the following format containing n number of records & i number of columns. If data needs to be grouped by the first column, what is the efficient way to process it using Java? Let's say that n = 40 million.
The standard way could…

ram
- 747
- 2
- 11
- 34
0
votes
1 answer
Trouble reading objects from binary file in Java
I'm trying to read the serialized data from a .dat file into its corresponding java class file. My .readObject() method keeps throwing ClassNotFoundException though. Why cant it read the data from the file? I'm trying to read it into a student class…

ComicalGamer
- 49
- 8
0
votes
1 answer
File Input cuts off first word
I am writing a program that should be able to take input, create a file, and store that information. I have successfully done that part. The program should also be able to print a previous file to the screen. The problem I get is that it cuts off…
user5336127
0
votes
0 answers
PHP preg_match_all vs custom file search
I need to parse out some strings from two types of files
File type one lines with subpattern
l('some string')
l('some other string', $mod = "anything")
File type two lines with subpattern
{l s='some string' mod='anything'}
{l s='some other string'…

jave.web
- 13,880
- 12
- 91
- 125
0
votes
1 answer
how to process plenty of files by multi-thread in java
Now I have plenty of JSON files on local, I need read these files and transfer them to JSONObject then do some business logical, such as find out the child-node then return, count some special value then return.
As the single file, I have finished…

leo
- 35
- 1
- 1
- 7
0
votes
0 answers
rsync script expands variable incorrectly
I have a script that takes in a unique location number from a file. These are formatted like this 7325-05, 5269-09 and 7479-14, for example. The first four numbers are what the folder is called and the second number is the first two characters of…

Emil Visti
- 55
- 1
- 6
0
votes
1 answer
delete lines from file in python
I have a file formated like this:
#1 0.13297254902 0.324803921569 0.434835294118 ...#many floats in one line
#2 0
#3 0.377305882353 0.595870588235 0.353215686275 ...
#4 1 #0/1 for the second line
#5 ....
I want to process the file so that all…

Mandary
- 45
- 1
- 7
0
votes
2 answers
remove line from file if more than one pattern appears in different line
I have a file with a patter like this:
1 1 1 2 0 1 0.5
1 2 2 2 0 2 0.5
2 1 1 1 0 1 0.25
2 1 2 2 0 2 0.5
2 3 3 3 0 3 0.25
I want to remove a line if another line in the file has the same last two entries. In the example above this means that line 4…

Aplln
- 45
- 6
0
votes
1 answer
File processing using try-catch C++
I'm working on a project about file processing. The users input ID, hours, and payrate. The output will be ID, hours, payrate and grosspay. I got those parts done. I really need help on try and catch, where users input a non-numeric, the project…

Van Le
- 31
- 1
- 2
0
votes
1 answer
How to replace single quote to double quote by awk when under Windows?
I tried gsub() but it didn't work. Here is the command:
awk -v a="'" b=" \" " "gsub(a,b,$0){print $0}" D:\re.json
or anybody could tell me what is the right escape character in Windows command line?

wanderlustwei
- 1
- 3
0
votes
1 answer
How to deal with big JSON file in R?
I have a JSON file sizing in 500mb, and need to process it in R using fromJSON.
I've tried bigmemory packages but still failed. Either crashed or reached the memory limits.
Some code I had used like these
raw<-…

wanderlustwei
- 1
- 3