Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'String Pattern' topicStudent Support Forum > General > "String Pattern"

Next Comment >Help | Reply To Topic
Author Comment/Response
Daniele Lupo
12/04/06 03:36am

Hi to all..

I've a little problem in importing data.

I use Import[file,"Table"] to importe a table of numbers. The problem is that, in the file, there are comment rows, that start with "!" character, so i obtain a list in the form:

{
{"!","word",...},
{number, number,...},
{"!","word",..},
{"!word",...}
}

The last is the case in which ! is attached to the first word.

When I use

DeleteCases[table, {"!",___}]

I eliminate only rows with "!", but elements that have, as first element, "!word", are not deleted. So I've tried a pattern matching

DeleteCases[table, {"!"~~___,___}]

But it does't work.

How can I eliminate rows of table that start with words that have "!" as first character?

Daniele

URL: ,

Subject (listing for 'String Pattern')
Author Date Posted
String Pattern Daniele Lupo 12/04/06 03:36am
Re: String Pattern yehuda ben-s... 12/05/06 06:09am
Re: String Pattern Daniele Lupo 12/05/06 2:02pm
Re: String Pattern yehuda ben-s... 12/06/06 05:55am
Re: String Pattern Daniele Lupo 12/08/06 05:40am
Next Comment >Help | Reply To Topic