Questions tagged [fileparsing]

170 questions
1
vote
1 answer

k6 script: How to parse file info to use in HTTP query

I am new to k6 & newish to JS. I am trying to read a list from a flat file that I exported from a column in DB. I want to open this file & loop through the list appending each item as a query param for my HTTP call. I cannot figure out how to…
OceanBlue
  • 9,142
  • 21
  • 62
  • 84
1
vote
1 answer

Python parsing file into dictionary of list of lists: for loop is only appending last line

I am trying to parse through a file with consistent formatting: a header and several lines of text split by spacing. I want to start a new dictionary key when a line has one value, read the following lines into a list of lists with each list being…
mshyu24
  • 13
  • 3
1
vote
2 answers

help merging perl code routines together for file processing

I need some perl help in putting these (2) processes/code to work together. I was able to get them working individually to test, but I need help bringing them together especially with using the loop constructs. I'm not sure if I should go with…
jdamae
  • 3,839
  • 16
  • 58
  • 78
1
vote
1 answer

Read tab separated content line by line with last column empty string

I have a file format like this 1.9969199999999998 2.4613199999999997 130.81278270000001 AA 2.4613199999999997 2.5541999999999998 138.59131554109211 BB 2.5541999999999998 2.9953799999999995 146.83238401449094 …
Swapnil
  • 1,870
  • 2
  • 23
  • 48
1
vote
4 answers

File processing in java

I have a file of size 2GB which has student records in it. I need to find students based on certain attributes in each record and create a new file with results. The order of the filtered students should be same as in the original file. What's the…
Srini Kandula
  • 981
  • 2
  • 18
  • 47
1
vote
1 answer

CSV file Missing Row Separator , how to read it in c #?

My CSV File Is as below , Name,Place, <<--- Headers Panindra,India, Kumar,India, As one can see the csv file contains extra "Comma" at end of each line instead of blank . and Row Breaker / Line Seperator is missing and hence Its…
panindra
  • 646
  • 2
  • 11
  • 33
1
vote
1 answer

Handling File Contents Before Writing to Disc C#

So I have decrypted a file and am left with a byte array containing this (Uni-encoded): Content-Type: text/plain; name="testfile.txt" Content-Transfer-Encoding: binary Content-Disposition: attachment; filename="testfile.txt" My super secret…
Petey B
  • 11,439
  • 25
  • 81
  • 101
1
vote
3 answers

grep -A until a string

assuming that we have a file containing the following: chapter 1 blah blah blah num blah num num blah num blah ... blah num chapter 2 blah blah and we want to grep this file so we take the lines from chapter 1 blah blah to blah num (the line before…
1
vote
1 answer

Given a trace of packets, how would you group them into flows?

I've tried it these ways so far: 1) Make a hash with the source IP/port and destination IP/port as keys. Each position in the hash is a list of packets. The hash is then saved in a file, with each flow separated by some special characters/line.…
zxcvbnm
  • 1,833
  • 3
  • 27
  • 35
1
vote
1 answer

Ruby: Using StringScanner causes infinite loop

I have the following class: require 'strscan' class ConfParser include Enumerable class Error < StandardError; end VERSION = '0.0.1' SECTION_REGEX = /^\[ # Opening bracket ([^\]]+) # Section name …
dennismonsewicz
  • 25,132
  • 33
  • 116
  • 189
1
vote
1 answer

Check if html files name in assets folder matches fetched string(country_name) value

I am working on an Android application and I have a small problem. I have a list of html files in the assests folder, all named accordingly to country names such as "United Kingdom.html" and I have user selecting country name from a listview, I…
f78xd23
  • 117
  • 2
  • 15
1
vote
2 answers

Nothing happening after the fgetcsv loop. Trying to save data from a tab delimitted report from amazon mws api

while ($keys = fgetcsv($fp, 0, "\t")) { if ($c == 0) { $headers = $keys; } else { $rows[] = $keys; //var_dump($keys); } $c ++; } fclose($fp); echo count($rows); If I echo…
rashid
  • 306
  • 3
  • 12
1
vote
1 answer

Single-Pass File Scanning

In my file scanning D program I'm implementing a logic for finding all hits of set of key strings together with line and column context similar to Grep. My current algorithm works by calling find until end of file. When a hit is found I search…
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
1
vote
1 answer

How to use phpmailer in combination with html-email-template in codeigniter correctly?

I have a problem and i'm really desperate. Here the situation: I wanna send a newsletter html email via codeigniter. This is my controller: if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class mail extends CI_Controller { …
user2718671
  • 2,866
  • 9
  • 49
  • 86
1
vote
1 answer

Error's on Configuration File Parsing

I am having some problems with some sample coding I have. Ideally I want a file that will have key words, that have data (int and strings) associated with them that can be changed. I will have duration (int), destination(string), and source(source)…
user2630969
  • 57
  • 1
  • 6