|
Hi Emanuele On Tuesday 31 July 2001 2:27 pm, Emanuele Salvador wrote: > I need to convert on my Linux box some ASCII files retrieved with FTP > from an AS400 from fixed width to tab delimited text. > Has anybody some experience with sed or awk to do so? Or is there a way > (aside from CA transfer) to accomplish this task? > Thanks in advance and excuse my poor english, > > Emanuele Salvador > Consorzio Florida Servizi Are you able to have the files generated in a different format on the AS/400 in the first place? What I mean is, are they created as ascii files for your benefit, ready for ftp-ing. There are a few options for converting DB2/400 files to streamfiles in various formats using the CPYTOIMPF command. If you get them as .csv files you can use the tr command to convert to your required format along the lines of $ tr ',' '\t' < file.csv > file.tab as I just discovered (had to convert a strange tab delimted file to .csv format). Unfortunately I've not (yet) any experience of sed or awk :-( I do have a .csv file generator tool[1] that could be tweaked into generating the appropriate tab format if you are interested. The closest I've come to CA functionality is to use my CRTCSVDTA utility in conjuction with the RUNRMTCMD to get the rexecd server on my linux box pull the file from the IFS and open it up on my desktop. > end user v. A command regrettably not implemented in most operating > systems. PWRDWNUSR ? :-) Regards, Martin [1] http://www.dbg400.net/crtcsv.html -- martin@dbg400.net / jamaro@firstlinux.net http://www.dbg400.net DBG/400 - DataBase Generation utilities Open Source test environment tools for the AS/400 / iSeries and miscellaneous database & spooled file management commands. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.