Reply to topic  [ 1 post ] 
textload .i for any newline style, .csv, tab delimited files 
Author Message
Yorick Master

Joined: Mon Nov 22, 2004 9:43 am
Posts: 354
Location: Livermore, CA, USA
Post textload .i for any newline style, .csv, tab delimited files
I just added i/textload.i, which defines two functions: text_lines and text_cells useful for reading text files from any source into yorick. People often give me files with Windows/DOS or old Mac style newlines, which confuse the ordinary yorick ascii I/O functions. Both of the new functions (and the text_load worker they share) deal with any newline style.

The text_lines function simply returns every line of the file as a a 1D array of strings.

The text_cells function returns a 2D array of strings, with the first dimension corresponding to either comma separated or tab delimited column separators in the input file. In the case of comma separated columns, text_cells handles the escape conventions of the .csv format which most spreadsheet programs recognize. Thus, text_cells provides an easy way to read spreadsheets into yorick.


Sun Sep 07, 2008 12:43 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.