Questions tagged [string-parsing]

The action of retrieving data from a string

String parsing is the action of extracting or modifying data pieces from a string. For example, one might parse a string to remove all quotation marks or to find all items inside quotation marks.

970 questions
-1
votes
1 answer

String tokenizer and parsing plain text JAVA

I am making a simple text based card game for fun/practice with parsing files. I have a plain text file with all the specs for the card. My cards are split with "##########". They are multilined. For now I simply want to be able to pull up the…
StreamingBits
  • 137
  • 11
-1
votes
1 answer

construct a vector from brackets of integers

I was wondering how to do the following efficiently. Given brackets of integers, create a stl vector accordingly? e.g. given [[-9],[-8,0],[-3,2,5],[6,3,0,-4],[-2,-9,-5,-8,6],[0,-5,0,-2,-1,5],[0,6,-1,-5,-8,6,-5],[-8,-5,-9,-8,-4,-3,-5,7]] then,…
pepero
  • 7,095
  • 7
  • 41
  • 72
-1
votes
1 answer

Regex to carry out parsing

I want to pull the data out of some strings from an event log. All Event strings start with [0r(1)2[000p[040qe1w3h162[020t*. upon encountering a new one, it should parse the last string set and get some data. an example event is shown. also several…
Zigmaphi
  • 15
  • 5
-1
votes
1 answer

Parsing code to detect function blocks

I'm writing a plugin for sublime text editor (using Python) that will fold only functions/methods on file load. In order to do this I have to parse file contents, detect function blocks and get start and end position of each block (this is needed…
marcin_koss
  • 5,763
  • 10
  • 46
  • 65
-1
votes
2 answers

Remove slashes from date and file extension from string

I need to do two things with strings: A. Remove the file extension B. Remove the '-' from the dates. An example of an uploaded string is: ifrs_au-cor_2013-03-12.xsd I can't just do a replace on '-' because the first part of the string contains a…
john cs
  • 2,220
  • 5
  • 32
  • 50
-1
votes
1 answer

How to get String from http in JSF

I'm interested how I can get the String "Cables" from this http: http://122.211.222.137:8080/test/RackProfile.jsf?id=1122#Cables I use this in order to get the id: this.id =…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
-2
votes
4 answers

URL like string parsing in python

I need to parse a string which is more or less a url.. for example i have a string which is a URL tempString = "?var1=somevalue1&var2=somevalue2&var3=somevalue3" i need to parse the string tempString and get the value of var1 var2 and var3 from it.…
Jeyanth Kumar
  • 1,589
  • 3
  • 23
  • 48
-2
votes
4 answers

Find and replace content within string (C#)

The below string is coming from a DIV tag. So I have enclosed the value below. String cLocation = "'target="_blank'>testimage.jpg
Anirudh
  • 581
  • 5
  • 14
  • 32
-2
votes
1 answer

The compiler does not accept my JSON notation

"Uncaught SyntaxError: Unexpected token c in JSON at position 2" This is what my compiler says. In JSON I wrote: { chGamma:7.5, chTheta:7.5, dgamma:0.01, distance:10.5, dtheta:0.03, freq:1, gamma:90, maaiveld:0.0, maxX:0, maxY:0, maxZ:0, minX:0,…
-2
votes
1 answer

How to validate a string like '$Now + 2h' using regex, for JS?

I have a user input to validate: String is made up of Part 1 + Part 2. Part 1 can be '$Now' or '$Today' or '$CurrentMonth'. Part 1 is mandatory. Part 2 can be '+' or '-' Followed by number and a unit. Number can be any number, and Unit should be…
red_wolf
  • 77
  • 13
-2
votes
1 answer

Hexadecimal to String conversion to extract values between STX and ETX by eliminating SPACE

I have the following hexadecimal byte array: Byte[] Bytes = { 0x02, 0x31, 0x20, 0x20, 0x20, 0x20, 0x32, 0x36, 0x38, 0x30, 0x34, 0x03, 0x0D }; And I converted the it to a string using BitConverter: String value =…
Sumi
  • 157
  • 1
  • 3
  • 15
-2
votes
1 answer

Optimized parse text file, to then upload to Excel

My project is to take large amounts of logs, output inside text files and parse some of the data to be made into Excel format. There is a lot of garbage data in between not needed This is how one portion of it is like: 2018-05-17…
Antonio
  • 3
  • 4
-2
votes
1 answer

How to extract the row data-wise data with column constraint from a text file in java

I am developing java Swing based desktop application without using database (file based application). whenever i am trying to extract the specified row wise data, the constraints were not working as expected. i am reading the entire text file line…
kishoor
  • 1
  • 1
-2
votes
1 answer

Java: How to parse time in the format `YYYYMMDDHHMMSSTTT`?

I am trying to read rows of a csv file. Each row represents a log history with timestamp at column 1. The timestamp is always in the form of YYYYMMDDHHMMSSTTT (to the millisecond). However, I do not know how to parse time in the format of…
user1769197
  • 2,132
  • 5
  • 18
  • 32
-2
votes
1 answer

How to correctly parse to LocalDate from String in Java?

I faced a strange issue. I can't parse String value to LocalDate. The problem is that in runtime I paused at breakpoint and execute parsing in evaluate expression tool and it works. But then I continue application and I get an exception with next…