Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Import text file table with some blank entries' topicStudent Support Forum > General > Archives > "Import text file table with some blank entries"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
molly
09/19/07 09:20am

In Response To 'Re: Import text file table with some blank entr...'
---------
Your advice was very helpful and informative, but I'm afraid I still have a problem. (This time I included an attached example: the alignment of protein sequences half-way down is what I really care about. (Spaces indicate no data for that position, and dots indicate deletions)).

It seems that columns in my data, in some places, are delimited by just a single space. Among other approaches, specifying that it is tab delimited will give me each row as a single string, with all the correct spaces maintained. However, because each row is a single string, I cannot go back in to specify how many characters belong to each column. What I'd like to be able to do, therefore, is turn each row that looks like this: {"a b c"} into {a, ,b, ,c}. Or, is there a way to import such that each character, including spaces, are considered individual elements/strings and that I get tab-delimited lists? i.e. a b c/d e f is imported as {{a, ,b, ,c},{d, ,e, ,f}} or {{"a"," ","b"," ","c"},{"d"," ","f"}}?

In the attached example I also included what happens when I try: ReadList["file", Word, WordSeparators -> {" "},RecordLists -> True, NullWords -> True].

Thank you!
Molly

Attachment: example of problem.nb, URL: ,

Subject (listing for 'Import text file table with some blank entries')
Author Date Posted
Import text file table with some blank entries molly 09/18/07 1:55pm
Re: Import text file table with some blank entr... Forum Modera... 09/18/07 5:17pm
Re: Re: Import text file table with some blank ... molly 09/19/07 09:20am
< Previous CommentHelp | Reply To Comment | Reply To Topic