Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9175 > unrolled thread

Re: Problems reading text files with embedded delimiters

Started byKING NIGEL-NKI001 <nigel.king@cambiumnetworks.com>
First post2012-03-21 10:46 +0000
Last post2012-03-21 10:46 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Problems reading text files with embedded delimiters KING NIGEL-NKI001 <nigel.king@cambiumnetworks.com> - 2012-03-21 10:46 +0000

#9175 — Re: Problems reading text files with embedded delimiters

FromKING NIGEL-NKI001 <nigel.king@cambiumnetworks.com>
Date2012-03-21 10:46 +0000
SubjectRe: Problems reading text files with embedded delimiters
Message-ID<jkcbij$qfb$1@smc.vnet.net>
If the field delimiter is a comma then to follow the csv "specification" if t
here are commas in a field then the field should be enclosed in quotes. The p
roblem is not one for Mathematica, but the simple logic required to unambiguously generate a data interchange format.

I hope that helps

---
Nigel King
Mob US:+1 224 678 1438
Mob UK:+44 7917 803879
work:+44 1364 655516


On 20 Mar 2012, at 08:03, "Mark Coleman" <markspcoleman@gmail.com> wrote:

> Hi,
>
> I'm struggling with importing a large flat file into Mathematica. The file , which was pulled off one of my company's legacy mainframe systems,
> contains about 100 fields and several million rows, including a mix of
> dates, reals, and text. The fields are delimited by commas.
>
> One of the text fields, however, is quite large and contains commas,
> line feeds, carriage returns, etc -- lots of characters commonly used
> as delimiters. It is also a variable length field. There does not seem
> to be anything characters within the field that would allow the
> specification of a simple delimiter. I've tried the default Import[]
> command as well as various permutations of ReadList[] using Record,
> Word, and String specifications.
>
> I'm wondering if anyone could suggest an approach that would allow me
> to read this file. More precisely, is there a way to avoid reading
> characters embedded in the large text field that Mathematica thinks are field
> delimiters?
>
> Thanks,
>
> Mark
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web