delimiter

how to break ^M into separate lines?

I am new to java programming. I have a program which I wrote to interperate data from my car. I am running into problems with using raw data instead of cooked data. public static void readFile(String fromFile) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(fromFile)); //... Loop as long as ...

How to do a while loop with a string redirected into it

Im trying to loop though a string with HTTP links inside and newlines, I want to loop over a line at a time. At the moment I have echo -e "$HTTP_LINKS" | while read HTTP_S_LINK ; do TEST_STRING="test" done But this way I don't have access to the TEST_STRING out side the loop, which is what I want. I'm using the while loop so that...

One type of delimiter in one date time string in RegEx

Hi all, Is there any way to write a Regex that can validate one type of delimiter in one date time string only? For example, 30/04/2010 is correct but 30-04/2010 is incorrect. I googled and found something about backtrack but I am not very sure how to use it. For example, if i have this regex: (?P<date>((31(?![\.\-\/\—\ \,\–\-]{1...

Which problems can delimiting DB identifiers cause?

Hi. I've just found the following in the Doctrine manual: Just because you CAN use delimited identifiers, it doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve. Anyway, it may be necessary when you have a reserved word as a field name (in this case, we suggest you to chan...

Issues converting csv to xls in Java? Only core Java experience needed - question not related to import.

Hey everyone, First of all, I understand that it's unusual that I want to up-convert like this, but please bear with me. We get these csv files via website export and we have no options to get it in any other form. Now, onto the question: I have this old code that will do this process for me. It basically reads each line, then picks o...

are there other non-printable characters in SSIS

From within SSIS, {t}, {CR}, {LF}, and {CR}{LF} are listed in the dropdown of row and column delimiters. I was wondering if there are other nomenclatures using the braces notation for non-printable characters? I've tried the following without success: {bell} - bell {b} - backspace {^^} - column delimiter control character ...

Validating data received in a non blocking server

I am building a non blocking server using javas NIO package, and have a couple questions about validating received data. I have noticed that when i call read on a socket channel, it will attempt to fill the byte buffer that it is reading to (as per the documentation). When i send 10 bytes to the server from the client, the server will r...

Delimiter for meta data in Windows file name

I'm working on maintenance of an application that transfers a file to another system and uses a structured filename to include meta data including a language code. The current app uses a two character language code and a dash/hyphen for a delimiter. Ex. Canada-EN-ProdName-ProdCode.txt I'm converting it to use IETF language code and so...

Remove delimiter using C#

I Have a string as follows: {a{b,c}d} if i give 1, the string must be displayed as: {a d} the content within inner braces should be removed along with the braces. Can anyone help me with it? ...

Best way to build a delimited string from a list in java

I have a list of objects, and each object has a string property. For example, I have a List<Person> and each Person has a firstName property. I want to build a comma-delimited, quoted string that looks like this: 'James', 'Lily', 'Michael' Considering that java doesn't seem to have a join method (and besides, this is a bit more compli...

strtok is using wrong delimiter.

Why is my strtok breaking up my strings after space when I specified my delimiter as ","? ...

Change the delimiter in a csv export

Okay I have my csv builder essentially working. it has 3 columns. Name, Position, Date. Unfortunately right now the export has 4 columns. Last name, First name, position, date. This is because the data I get out of my data base for the name goes Last, First. Is there anyway I can easily change this delimiter? This would be very convenien...

C# List<string> to string with delimiter

This is my first question so hello to all users! Is there a function in C# to quickly convert some collection to string and separate values with delimiter? For example: List<string> names --> string names = "John, Anna, Monica" ...

How do I implement my own escape sequence when using split() in perl?

I'm trying to write a parser for the EDI data format, which is just delimited text but where the delimiters are defined at the top of the file. Essentially it's a bunch of splits() based on values I read at the top of my code. The problem is theres also a custom 'escape character' that indicates that I need to ignore the following delim...

easy way to determine if a string CAN'T be a valid regex

I have a config file that the user can specify sections, and then within those section they can specify regular expressions. I have to parse this config file and separate the regex's into the various sections. Is there an easy way to delimitate a regex from a section header? I was thinking just the standard [section] regex1 regex2 B...

Spring DataSourceInitializer splits trigger ins sql by ; delimiter

We use org.springframework.batch.test.DataSourceInitializer class in order to init DB on basis of .sql scripts. Init was failed,after trigger had been added to .sql. After debugging,the cause of error while was found here: try { scripts = StringUtils.delimitedListToStringArray(stripComments(IOUtils.readLines(scriptResource.getInputStr...

Determining delimeter for a structured section in a text file using a hex viewer

I have a text file with structured data. After each text block it says "END" and continues onto the next block. Looking at a hex viewer I see 0A:45:4E:44:0A:20:20:20:20:20:20:20:20:20 which translates into ?END? Notice the 9 spaces. How do I write this as a delimeter in my code? "END\n\n\n \n \n \n \n \n \n" This doe...

How to strip variable spaces in each line of a text file based on special condition - one-liner in Python?

I have some data (text files) that is formatted in the most uneven manner one could think of. I am trying to minimize the amount of manual work on parsing this data. Sample Data : Name Degree CLASS CODE EDU Scores -------------------------------------------------------------------------------------- John M...

Best/common practice to delimit values in C when printing them.

I tried the search function but only found questions regarding reading in comma/space delimited files. My question is however, how do you usually approach this. Say I have a list/array/... of values, like {1, 2, 3, 4} and want to print them with a delimiter. The simplest version would be something like: #include <stdio.h> int main(...

Parse column value based on delimeters

Here is a sample of my data: ABC*12345ABC BCD*234() CDE*3456789(&(& DEF*4567A*B*C Using SQL Server 2008 or SSIS, I need to parse this data and return the following result: 12345 234 3456789 4567 As you can see, the asterisk (*) is my first delimiter. The second "delimiter" (I use this term loosely) is when the sequence of numbers ST...