text-parsing Questions
6
Solved
I have a string like this:
key=value, key2=value2
and I would like to parse it into something like this:
array(
"key" => "value",
"key2" => "value2"...
Basilisk asked 7/2, 2011 at 16:51
10
Solved
Two days ago I started working on a code parser and I'm stuck.
How can I split a string by commas that are not inside brackets? Let me show you what I mean.
I have this string to parse:
one, two, t...
Wirework asked 5/7, 2009 at 20:27
3
Solved
Example strings:
accuracy-is-5
accuracy-is-5-or-15
accuracy-is-5-or-15-or-20
package-is-dip-8-or-dip-4-or-dip-16
My current regexp:
/^([a-z0-9\-]+)\-is\-([a-z0-9\.\-]*[a-z0-9])(?:\-or\-([a-z0-9...
Orchid asked 27/5, 2015 at 12:38
6
Background: I want to read some data from a text file, into a polars dataframe. The data starts at the line containing the string foo, and stops at the first empty line afterwards. Example file tes...
Related asked 20/3 at 22:53
1
First... Would it be possible to accomplish simple syntax highlighting using a PEG.
I'm only looking for it to be able to recognize and highlight basic things that are common to c style languages
...
Pyrophosphate asked 8/10, 2013 at 18:42
13
Solved
I am using awk to perform counting the sum of one column in the csv file. The data format is something like:
id, name, value
1, foo, 17
2, bar, 76
3, "I am the, question", 99
I was using this aw...
Sulemasulf asked 29/6, 2010 at 6:35
6
Solved
//go through each question
foreach($file_data as $value) {
//separate the string by pipes and place in variables
list($category, $question) = explode('|', $value);
//place in assoc array
$data...
Eustis asked 21/3, 2011 at 23:11
6
Solved
I have a form that contains a number of fields with names item1, item2, item13, item43 etc, each time those fields are different because they are populated in the form with AJAX.
When user submits ...
Binate asked 9/1, 2013 at 20:10
3
Solved
In PS 5.0 I can split and trim a string in a single line, like this
$string = 'One, Two, Three'
$array = ($string.Split(',')).Trim()
But that fails in PS 2.0. I can of course do a foreach to tri...
Tonina asked 24/8, 2018 at 23:33
6
Solved
I have several strings of the format
AA11
AAAAAA1111111
AA1111111
I need to separate the alphabetic and numeric components of the string.
Monopteros asked 13/7, 2012 at 19:47
4
Solved
Is there an simple way of turning a string from
Then go to http:/example.com/ and foo the bar!
into
Then go to <a href="http://example.com">example.com</a> and foo the bar!
in Ja...
Huoh asked 29/3, 2010 at 5:52
4
Solved
I have a line like this in my code:
list($user_id, $name, $limit, $remaining, $reset) = explode('|', $user);
The last 3 parameters may or may not be there. Is there a function similar to list that...
Irreversible asked 12/3, 2013 at 15:31
21
Solved
I was wondering what the simplest way is to convert a string representation of a list like the following to a list:
x = '[ "A","B","C" , " D"]'
Even in case...
Exorcism asked 12/12, 2009 at 18:19
4
Solved
when I chunk text, I get lots of codes in the output like
NN, VBD, IN, DT, NNS, RB.
Is there a list documented somewhere which tells me the meaning of these?
I have tried googling nltk chunk code ...
Disturb asked 29/3, 2015 at 18:8
11
Solved
I'm looking for a way that I can extract the first letter of each word from an input field and place it into a variable.
Example: if the input field is "Stack-Overflow Questions Tags Users" then t...
Fulmis asked 9/9, 2010 at 14:56
10
Solved
I have raw html with some css classes inside for various tags.
Example:
Input:
<p class="opener" itemprop="description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque mole...
Nevus asked 8/1, 2014 at 18:12
4
Solved
Is there any way to save the draw image from tree.draw() to an image file programmatically? I tried looking through the documentation, but I couldn't find anything.
Guarantor asked 2/5, 2014 at 13:16
21
Solved
How would I use sed to delete all lines in a text file that contain a specific string?
Adkison asked 23/3, 2011 at 19:46
3
Solved
I am trying to compact an expression of individual days into a shorter expression including hyphen-separate ranges.
Examples:
mon,tue,wed,thu,fri,satto be:mon-sat
mon,tue,wed,fri,satto bemon-wed,f...
Zwieback asked 10/5, 2011 at 2:15
8
Solved
I want to translate/hydrate/expand/parse a comma-separated string of integers and hyhenated integer range expressions and populate an array with its equivalent values as individual integers element...
Handicap asked 8/10, 2011 at 17:52
6
Solved
I have a string like:
$Order_num = "0982asdlkj";
How can I split that into the 2 variables, with the number as one element and then another variable with the letter element?
The number e...
Gilson asked 27/12, 2010 at 10:17
12
Solved
How can I replace a particular line of text in file using php?
I don't know the line number. I want to replace a line containing a particular word.
Republican asked 9/6, 2010 at 8:9
6
Solved
I have a string containing a ten-digit phone number and I want to format it with hyphens.
I am seeking a way to convert 123456790 to 123-456-7890 as phone numbers are typically formatted in the USA...
Camey asked 23/2, 2010 at 0:32
3
Solved
I have some strings which can be in the following format:
sometext moretext 01 text
text sometext moretext 002
text text 1 (somemoretext)
etc
I want to split these strings into following:
text be...
Margy asked 15/1, 2013 at 22:23
4
Solved
I am writing a small DB test suite, which reads configuration files with queries and expected results, e.g.:
query = "SELECT * from cities WHERE name='Unknown';"
count = 0
level = 1
name = "Check ...
Snide asked 11/2, 2010 at 16:6
1 Next >
© 2022 - 2024 — McMap. All rights reserved.