Search Results

Search found 428 results on 18 pages for 'delimited'.

Page 1/18 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How Do I Convert Pipe Delimited to Comma Delimited with Escaping

    - by Russ Bradberry
    Hi, I am fairly new to scala and I have the need to convert a string that is pipe delimited to one that is comma delimited, with the values wrapped in quotes and any quotes escaped by "\" in c# i would probably do this like this string st = "\"" + oldStr.Replace("\"", "\\\\\"").Replace("|", "\",\"") + "\"" I haven't validated that actually works but that is the basic idea behind what I am trying to do. Is there a way to do this easily in scala?

    Read the article

  • How to skip extra lines before the header of a tab delimited delimited file in R

    - by Michael Dunn
    The software I am using produces log files with a variable number of lines of summary information followed by lots of tab delimited data. I am trying to write a function that will read the data from these log files into a data frame ignoring the summary information. The summary information never contains a tab, so the following function works: read.parameters <- function(file.name, ...){ lines <- scan("tmp.log", what="character", sep="\n") first.line <- min(grep("\\t", lines)) return(read.delim(file.name, skip=first.line-1, ...)) } However, these logfiles are quite big, and so reading the file twice is very slow. Surely there is a better way?

    Read the article

  • Excel and Tab Delimited Files Question

    - by OneNerd
    I am encountering what I believe to be a strange issue with Excel (in this case, Excel 2007, but maybe also Excel 2003, but don't have access to it as I write this). I can reliably convert some server data over into a tab-delimited format (been doing this for years) and then open it using Excel - no issue. However, what seems to be happening is if I have an html <table inside one of the fields, it looks like Excel 2007 thinks it should be converting the table into rows and columns inside Excel (not what I want). As you might imagine, this throws off the entire spreadsheet. So question is, is there any way to set up excel to NOT do this (perhaps some setting in Excel that pertains to reading tab delimited files), or am I missing something? Thanks.

    Read the article

  • Python - Nested List to Tab Delimited File?

    - by Seafoid
    Hi, I have a nested list comprising ~30,000 sub-lists, each with three entries, e.g., nested_list = [['x', 'y', 'z'], ['a', 'b', 'c']]. I wish to create a function in order to output this data construct into a tab delimited format, e.g., x y z a b c Any help greatly appreciated! Thanks in advance, Seafoid.

    Read the article

  • Send comma delimited CSV through SFTP?

    - by JM4
    I am collecting registration information on my site and need to figure out how to pass all data stored in the MySQL DB (or just portions of it) as a comma delimited CSV file through an SFTP so our partners can access the information. The pages are built using PHP. I literally have no idea how to do this and am hoping somebody has experience doing so. Thanks ahead of time!

    Read the article

  • Parsing large delimited files with dynamic number of columns

    - by annelie
    Hi, What would be the best approach to parse a delimited file when the columns are unknown before parsing the file? The file format is Rightmove v3 (.blm), the structure looks like this: #HEADER# Version : 3 EOF : '^' EOR : '~' #DEFINITION# AGENT_REF^ADDRESS_1^POSTCODE1^MEDIA_IMAGE_00~ // can be any number of columns #DATA# agent1^the address^the postcode^an image~ agent2^the address^the postcode^^~ // the records have to have the same number of columns as specified in the definition, however they can be empty etc #END# The files can potentially be very large, the example file I have is 40Mb but they could be several hundred megabytes. Below is the code I had started on before I realised the columns were dynamic, I'm opening a filestream as I read that was the best way to handle large files. I'm not sure my idea of putting every record in a list then processing is any good though, don't know if that will work with such large files. List<string> recordList = new List<string>(); try { using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read)) { StreamReader file = new StreamReader(fs); string line; while ((line = file.ReadLine()) != null) { string[] records = line.Split('~'); foreach (string item in records) { if (item != String.Empty) { recordList.Add(item); } } } } } catch (FileNotFoundException ex) { Console.WriteLine(ex.Message); } foreach (string r in recordList) { Property property = new Property(); string[] fields = r.Split('^'); // can't do this as I don't know which field is the post code property.PostCode = fields[2]; // etc propertyList.Add(property); } Any ideas of how to do this better? It's C# 3.0 and .Net 3.5 if that helps. Thanks, Annelie

    Read the article

  • making arrays from tab-delimited text file column

    - by absolutenewbie
    I was wondering if anyone could help a desperate newbie with perl with the following question. I've been trying all day but with my perl book at work, I can't seem to anything relevant in google...or maybe am genuinely stupid with this. I have a file that looks something like the following: Bob April Bob April Bob March Mary August Robin December Robin April The output file I'm after is: Bob April April March Mary August Robin December April So that it lists each month in the order that it appears for each person. I tried making it into a hash but of course it wouldn't let me have duplicates so I thought I would like to have arrays for each name (in this example, Bob, Mary and Robin). I'm afraid to upload the code I've been trying to tweak because I know it'll be horribly wrong. I think I need to define(?) the array. Would this be correct? Any help would be greatly appreciated and I promise I will be studying more about perl in the meantime. Thank you for your time, patience and help. #!/usr/bin/perl -w while (<>) { chomp; if (defined $old_name) { $name=$1; $month=$2; if ($name eq $old_name) { $array{$month}++; } else { print "$old_name"; foreach (@array) { push (@array, $month); print "\t@array"; } print "\n"; @array=(); $array{$month}++; } } else { $name=$1; $month=$2; $array{month}++; } $old_name=$name; } print "$old_name"; foreach (@array) { push (@array, $month); print "\t@array"; } print "\n";

    Read the article

  • Importing a large delimited file to a MySQL table

    - by Tom
    I have this large (and oddly formatted txt file) from the USDA's website. It is the NUT_DATA.txt file. But the problem is that it is almost 27mb! I was successful in importing the a few other smaller files, but my method was using file_get_contents which it makes sense why an error would be thrown if I try to snag 27+ mb of RAM. So how can I import this massive file to my MySQL DB without running into a timeout and RAM issue? I've tried just getting one line at a time from the file, but this ran into timeout issue. Using PHP 5.2.0. Here is the old script (the fields in the DB are just numbers because I could not figure out what number represented what nutrient, I found this data very poorly document. Sorry about the ugliness of the code): <? $file = "NUT_DATA.txt"; $data = split("\n", file_get_contents($file)); // split each line $link = mysql_connect("localhost", "username", "password"); mysql_select_db("database", $link); for($i = 0, $e = sizeof($data); $i < $e; $i++) { $sql = "INSERT INTO `USDA` (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17) VALUES("; $row = split("\^", trim($data[$i])); // split each line by carrot for ($j = 0, $k = sizeof($row); $j < $k; $j++) { $val = trim($row[$j], '~'); $val = (empty($val)) ? 0 : $val; $sql .= ((empty($val)) ? 0 : $val) . ','; // this gets rid of those tildas and replaces empty strings with 0s } $sql = rtrim($sql, ',') . ");"; mysql_query($sql) or die(mysql_error()); // query the db } echo "Finished inserting data into database.\n"; mysql_close($link); ?>

    Read the article

  • retrieve comma delimited data from a field in using SQL

    - by Nichols
    I've created a form in php that collects basic information. I have a list box that allows multiple items selected (ie housing, rent, food, water). If multiple items are selected they are stored in a field called Needs seperated by a comma. I have created a report ordered by the persons needs. The people who only have one need are sorted correctly, but the people who have multiple are sorted exactly as the string passed to the database (ie. housing, rent, food, water) -- which is not what i want. Is there a way to seperate the multiple values in this field using SQL to count each need instance/occurance as 1 so that there are no comma delimitations shown in the results? CLICK FOR EXAMPLE

    Read the article

  • Sub-Select to Delimited List in T-SQL

    - by Doug Lampe
    The following transact-SQL statement can be used with Microsoft SQL Server to create a delimited list from a sub-query.  In this case the delimiter is a comma. SELECT Left(item,LEN(item)-1)as delimited_list FROM (     select       CAST       (          (               select original_item + ','               from TABLE             where condition_field = 'value'             for xml path ('')           )   as varchar(max)      ) as item ) as temp

    Read the article

  • Sorting a REALLY BIG delimited text file in UNIX / VMS [closed]

    - by gunbuster363
    Hi everyone, I am going to sort a REALLY BIG delimited text file, say 250Mb (or a bunch of files of more or less than 250Mb) . It have 37 fields, and I need to sort it by 5 fields, for example 1st, 4th, 5th, 6th 7th fields. Under Unix / VMS, do I have a good option to do this FAST? I can write COBOL program. Now I am trying to sort them using the below command, but it already run for a long time and just not going to finished. Thank you. The command I used: time sort -t ',' -o sorted.txt +0 -1 +4 -5 +5 -6 +6 -7 +22 -23 *.DAT_gprscdr_ftpd

    Read the article

  • Importing tab delimited file into array in Visual Basic 2013 [migrated]

    - by JaceG
    I am needing to import a tab delimited text file that has 11 columns and an unknown number of rows (always minimum 3 rows). I would like to import this text file as an array and be able to call data from it as needed, throughout my project. And then, to make things more difficult, I need to replace items in the array, and even add more rows to it as the project goes on (all at runtime). Hopefully someone can suggest code corrections or useful methods. I'm hoping to use something like the array style sMyStrings(3,2), which I believe would be the easiest way to control my data. Any help is gladly appreciated, and worthy of a slab of beer. Here's the coding I have so far: Imports System.IO Imports Microsoft.VisualBasic.FileIO Public Class Main Dim strReadLine As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sReader As IO.StreamReader = Nothing Dim sRawString As String = Nothing Dim sMyStrings() As String = Nothing Dim intCount As Integer = -1 Dim intFullLoop As Integer = 0 If IO.File.Exists("C:\MyProject\Hardware.txt") Then ' Make sure the file exists sReader = New IO.StreamReader("C:\MyProject\Hardware.txt") Else MsgBox("File doesn't exist.", MsgBoxStyle.Critical, "Error") End End If Do While sReader.Peek >= 0 ' Make sure you can read beyond the current position sRawString = sReader.ReadLine() ' Read the current line sMyStrings = sRawString.Split(New Char() {Chr(9)}) ' Separate values and store in a string array For Each s As String In sMyStrings ' Loop through the string array intCount = intCount + 1 ' Increment If TextBox1.Text <> "" Then TextBox1.Text = TextBox1.Text & vbCrLf ' Add line feed TextBox1.Text = TextBox1.Text & s ' Add line to debug textbox If intFullLoop > 14 And intCount > -1 And CBool((intCount - 0) / 11 Mod 0) Then cmbSelectHinge.Items.Add(sMyStrings(intCount)) End If Next intCount = -1 intFullLoop = intFullLoop + 1 Loop End Sub

    Read the article

  • How to Map a CSV or Tab Delimited File to MySQL Multi-Table Database [migrated]

    - by Keefer
    I've got a pretty substantial XLS file a client provided 830 total tabs/sheets. I've designed a multi table database with PHPMyAdmin (MySQL obviously) to house the information that's in there, and have populated about 5 of those sheets by hand to ensure the data will fit into the designed database. Is there a piece of software or some sort of tool that will help me format this XLS document and map it to the right places in the database?

    Read the article

  • Converting non-delimited text into name/value pairs in Delphi

    - by robsoft
    I've got a text file that arrives at my application as many lines of the following form: <row amount="192.00" store="10" transaction_date="2009-10-22T12:08:49.640" comp_name="blah " comp_ref="C65551253E7A4589A54D7CCD468D8AFA" name="Accrington "/> and I'd like to turn this 'row' into a series of name/value pairs in a given TStringList (there could be dozens of these <row>s in the file, so eventually I will want to iterate through the file breaking each row into name/value pairs in turn). The problem I've got is that the data isn't obviously delimited (technically, I suppose it's space delimited). Now if it wasn't for the fact that some of the values contain leading or trailing spaces, I could probably make a few reasonable assumptions and code something to break a row up based on spaces. But as the values themselves may or may not contain spaces, I don't see an obvious way to do this. Delphi' TStringList.CommaText doesn't help, and I've tried playing around with Delimiter but I get caught-out by the spaces inside the values each time. Does anyone have a clever Delphi technique for turning the sample above into something resembling this? ; amount="192.00" store="10" transaction_date="2009-10-22T12:08:49.640" comp_name="blah " comp_ref="C65551253E7A4589A54D7CCD468D8AFA" name="Accrington " Unfortunately, as is usually the case with this kind of thing, I don't have any control over the format of the data to begin with - I can't go back and 'make' it comma delimited at source, for instance. Although I guess I could probably write some code to turn it into comma delimited - would rather find a nice way to work with what I have though. This would be in Delphi 2007, if it makes any difference.

    Read the article

  • Don't understand the typing of Scala's delimited continuations (A @cps[B,C])

    - by jkff
    I'm struggling to understand what precisely does it mean when a value has type A @cps[B,C] and what types of this form should I assign to my values when using the delimited continuations facility. I've looked at some sources: http://lamp.epfl.ch/~rompf/continuations-icfp09.pdf http://www.scala-lang.org/node/2096 http://dcsobral.blogspot.com/2009/07/delimited-continuations-explained-in.html http://blog.richdougherty.com/2009/02/delimited-continuations-in-scala_24.html but they didn't give me much intuition into this. In the last link, the author tries to give an explicit explanation, but it is not clear enough anyway. The A here represents the output of the computation, which is also the input to its continuation. The B represents the return type of that continuation, and the C represents its "final" return type—because shift can do further processing to the returned value and change its type. I don't understand the difference between "output of the computation", "return type of the continuation" and "final return type of the continuation". They sound like synonyms.

    Read the article

  • Removing item from a comma delimited string when removed from list view

    - by Yogender Siwach
    I'm using a combo box to select an item from a list of 25 items. The selected item is input in a text box in a comma delimited string. It is updating a list view and showing each item separately by breaking the comma delimited string. The text box is not visible to users but doing the work in back end. Now I want to remove any item from list view and want it so that the text box containing the comma delimited string should also change and remove that item from the string. Is it possible?

    Read the article

  • Replace values in column, space delimited file in Vim

    - by user1256923
    I have a file that looks like: 2067 24311 <hkxhk> {00} 2069 17219 <hkxhk> {00} 2071 20931 <hkxhk> {00} 2073 5557 <hkxhk> {00} 2075 2127 <hkxhk> {00} 2077 20947 <hkxhk> {00} 2081 18088 <hkxhk> {00} I want to replace the first column value so that it looks like 5 24311 <hkxhk> {00} 5 17219 <hkxhk> {00} 5 20931 <hkxhk> {00} 5 5557 <hkxhk> {00} 5 2127 <hkxhk> {00} 5 20947 <hkxhk> {00} 5 18088 <hkxhk> {00} Where the first space delimited column has been replaced by a new value, in this case 5.

    Read the article

  • How to open semicolon delimited CSV-files in US-version of Excel

    - by Holgerwa
    When I double-click on a .csv file, it is opened in Excel. The csv-files have columns delimited with semicolons (not commas, but also a valid format). Using a German Windows/Excel setup, the opened file is displayed correctly, the columns are separated where the semicolons existed in the csv-file. But when I do the same on an (US-) English Windows/Excel setup, only one column is imported, showing the whole data including the semicolons in the first column. (I don't have an English setup available for tests, users have reported the behavior) I tried to change the list separator value in Windows regional settings, but that didn't change anything. What can I do to be able to double-click-open those CSV-files on an English setup? EDIT: It seems to be the best solution not to rely on CSV-files in this case. I was hoping that there is some formatting for CSV-files that makes it possible to use them internationally. The best solution seems that I'll switch to creating XLS-files. Thanks to all for your suggestions and helpful tips!

    Read the article

  • Converting delimited string to multiple values in mysql

    - by epo
    I have a mysql legacy table which contains an client identifier and a list of items, the latter as a comma-delimited string. E.g. "xyz001", "foo,bar,baz". This is legacy stuff and the user insists on being able to edit a comma delimited string. They now have a requirement for a report table with the above broken into separate rows, e.g. "xyz001", "foo" "xyz001", "bar" "xyz001", "baz" Breaking the string into substrings is easily doable and I have written a procedure to do this by creating a separate table, but that requires triggers to deal with deletes, updates and inserts. This query is required rarely (say once a month) but has to be absolutely up to date when it is run, so e.g. the overhead of triggers is not warranted and scheduled tasks to create the table might not be timely enough. Is there any way to write a function to return a table or a set so that I can join the identifier with the individual items on demand?

    Read the article

  • Converting delimited string to multiple values in mysql

    - by epo
    I have a mysql legacy table which contains an client identifier and a list of items, the latter as a comma-delimited string. E.g. "xyz001", "foo,bar,baz". This is legacy stuff and the user insists on being able to edit a comma delimited string. They now have a requirement for a report table with the above broken into separate rows, e.g. "xyz001", "foo" "xyz001", "bar" "xyz001", "baz" Breaking the string into substrings is easily doable and I have written a procedure to do this by creating a separate table, but that requires triggers to deal with deletes, updates and inserts. This query is required rarely (say once a month) but has to be absolutely up to date when it is run, so e.g. the overhead of triggers is not warranted and scheduled tasks to create the table might not be timely enough. Is there any way to write a function to return a table or a set so that I can join the identifier with the individual items on demand?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >