Questions tagged [file-processing]
333 questions
0
votes
3 answers
How to detect lines that are unique in large file using Reactive Extensions
I have to process large CSV files (up to tens of GB), that looks like this:
Key,CompletedA,CompletedB
1,true,NULL
2,true,NULL
3,false,NULL
1,NULL,true
2,NULL,true
I have a parser that yields parsed lines as IEnumerable, so that I reads…

Liero
- 25,216
- 29
- 151
- 297
0
votes
2 answers
How to iterate through very large text file separated by semicolons?
If I want to iterate through a text file line-by-line, here is how I do it:
for curr_line in open('my_file.txt', 'r').readlines()
print '|' + curr_line + '|'
If I want to iterate through a text based on semi-colon separators, here is how I do…

Saqib Ali
- 11,931
- 41
- 133
- 272
0
votes
2 answers
list files containing two specific strings into an array in bash
Inside a directory(without any subdirectories) I have several text files.
I want to create a array containing the list of files which contains specific two Strings say Started uploading and UPLOAD COMPLETE.
for i /directory_path/*.txt; do
…

RandomCoder
- 79
- 1
- 7
0
votes
1 answer
OSError: [Errno 22] Invalid argument Python File Processing
i am currently undergoing my A2 studies in Computer Science and i am having difficulties with random access file processing.
I am trying to have a list UsersArraywhich stores some record data types UsersArray = [lion,soso,Sxia] and loop through the…

luca ion
- 3
- 3
0
votes
1 answer
Split file in Unix based on occurence of some specific string
Contents of my file is as following
Tenor|CurrentCoupon
15Y|3.091731898890382
30Y|3.5773546584901617
Id|Cusip|Ticker|Status|Error|AsOfDate|Price|LiborOas
1|01F020430|FN 15 2 F0|1||20180312|95.19140625|-0.551161358515
2|01F020448|FN 15 2…

Abhishek Singh
- 10,243
- 22
- 74
- 108
0
votes
2 answers
Python pandas misses some end of line characters while loading csv file
I have a csv file (tab seperated) written in German. I did not create the file. I tried to read that file by using Python's pandas package. I do the following:
import pandas as pd
trn_file ="data/train.csv"
pd_train =…

zwlayer
- 1,752
- 1
- 18
- 41
0
votes
1 answer
Custom Java Regex: Match starting with and ending with
I've been struggling with this for a few days, and I was wondering maybe someone can help me with it.
What I am trying to accomplish is to process a text file which has a set of questions and answers. The contents of the file (.doc or .docx) look…

FuTwo10
- 3
- 3
0
votes
1 answer
Determine if a file contains a string in C
How can I check if a given FILE* contains a string in C running on Linux (if it matters)?
The string must consist of the whole line it's on. For example, this:
jfjfkjj
string
jfjkfjk
would be true; but…

Billy
- 1,177
- 2
- 15
- 35
0
votes
2 answers
ClosedXML can't delete file after saving Workbook "process in use"
So here's the code:
string filename = @"c:\test.xlsx";
using (XLWorkbook wb = CreateWorkbookInformation())
{
wb.SaveAs(filename);
…

White-N-Nerdy
- 21
- 1
- 4
0
votes
4 answers
how to delete a line(record) from a file using php
I want to delete a line which has unique id at the end of the line. how to delete the line? Is there any implementation of sed or awk in php? my file structure is as follows
1 0 * * * echo -n "cron 1" > /www/apache/logs/error_log #1
0 */2 * * * …

brainless
- 5,698
- 16
- 59
- 82
0
votes
1 answer
How to count patterns in multiple files using awk
I have multiple log files and I need to count the number of occurrences of certain patterns in all those files.
#!/usr/bin/awk
match($0,/New connection from user \[[a-z_]*\] for company \[([a-z_]*)\]/, a)
{instance[a[1]]++}
END {
for(i in…

cppcoder
- 22,227
- 6
- 56
- 81
0
votes
1 answer
Combine count files into one file and keep zero values
I have multiple count files that look like this:
File1.tab
6 10 0
49 0 53
15 0 15
0 0 0
0 0 0
0 0 0
Other file:
File2.tab
3 1 2
29 0 29
4 0 …

Leonor
- 53
- 6
0
votes
1 answer
Not able to initialize constructor
I am creating a program which includes a parent class Account and a derived class BankAccount. Initially, I have to set the balance in account to be 5000. And when certain transactions are made, this balance should be updated. Also, whenever the…

Resting Platypus
- 97
- 7
0
votes
2 answers
Return a number from text file using a keyword
I have two text files. The contents of both the files look something like this:
File 1 contents:
Apple 5
Mango 10
Orange 15
File 2 contents:
Apple 10
Mango 15
Orange 20
I am trying to make a program that takes a keyword (here a name of fruit) and…

Resting Platypus
- 97
- 7
0
votes
0 answers
Shell - Redirected namepiped tmp log file of nohup out writing junk logs
I am trying to create a logrotate script for a running nohup output ( without any line breakages - tried logrotate package in system and observed several log lines are getting missed while rotating the continuously generating log file). Here's the…

Riyas Siddikk
- 186
- 2
- 11