From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!enother.net!enother.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: re: is there Ada package similar to Matlab textscan? Date: Fri, 17 Jul 2015 04:25:44 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: ru/enNNyVkms/PPjid3aKA.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Xref: number.nntp.giganews.com comp.lang.ada:194142 Date: 2015-07-17T04:25:44+00:00 List-Id: That's a CSV file. I'm sure there are lots of folks' implementations. The important part of mine is: function Field_Name(Csv_File: Csv_Files; Index : Field_Counts) return String; -- raises Constraint_Error if Index not in 1 .. Header's Field_Count function Field_Index(Csv_File: Csv_Files; Name: String) return Field_Counts; -- Ignoring case, find first field whose prefix = Name -- returns zero if not found procedure Read_A_Record(Csv_File: in out Csv_Files); -- May End_Error. -- If a record has fewer fields than the header indicated, it's -- padded out with null strings. function Field_Content(Csv_File: Csv_Files; Index : Field_Counts) return String; -- Raises Use_Error if called before any Read_A_Record.