Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!nosc!crash!scotto From: scotto@crash.cts.com (Scott O'Connell) Newsgroups: comp.databases Subject: reading flat files in Informix Message-ID: <792@crash.cts.com> Date: 29 Nov 89 17:51:47 GMT Reply-To: scotto@crash.cts.com (Scott O'Connell) Organization: Crash TimeSharing, El Cajon, CA Lines: 40 I have a need to read in prepared text files with Informix 4GL. The application is to prepare a document with Word Perfect and save it in ASCII format. Here's an example of what I need to do: Have a saved WP document with keywords in the document. Have Informix open the file and read each line into text_line (ARRAY[67] OF CHAR(85)) until the end of file is reached. Here's what I was thinking, knowing what I know of the Informix functions in C (read: not much): CALL read_in_file() RETURNING text_line[1], text_line[2], ..., ..., text_line[67] Then, I could parse each text_line for keywords in 4GL. It would be even better if I could do something like: CALL open_text_file() WHILE NOT text_line[a][1,7] = "**END**" CALL read_line() RETURNING text_line[a] LET a = a + 1 END WHILE CALL close_text_file() I guess another way to do it would be create a table, load the flat file in line-by-line and get to the data that way. I guess that's an option. I'm not a C programmer (although I'm starting to learn), but even if I was, I think I'd still have problems trying to make this work. Thanks P.S. Are there any BBS's geared towards Informix programmers? -- Scott O'Connell UUCP: {nosc, ucsd, hplabs!hp-sdd}!crash!ipars!scotto ARPA: crash!ipars!scotto@nosc.mil INET: scotto@ipars.cts.com Brought to you by Super Global Mega Corp .com