× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 6/20/2016 4:37 PM, Darryl Freinkel (gmail) wrote:

I have a procedure that retrieves a file off a UNIX server onto the IFS.
I need to strip off the first character of the record if it is an 'S'.

*The* record? As in there is only one leading 'S' in the file?
Or *The first S of every record*?
Understanding that a Unix / stream file doesn't really have a concept of
'record' as we recognise it.

Is there an easy way to do this without having to import the file, strip the
character and then writing it back to the IFS?

I have sed and grep in both my PASE and QShell environments. It's been
so long that I'm not sure where I got them from. If I were starting out
now I'd probably hit up the YiPS:
http://yips.idevcloud.com/wiki/index.php/PASE/OpenSourceBinaries Check
out their chroot.

sed is only one way. Anything that can read stdin, run a regex and
write to stdout would work just as easily. Perl, PHP, and Python all
come to mind.

A completely untested regex off the top of my head:
find ^S(.*)
replace \1
With sed, that might look like sed -E "s/^S(.*)/\1/" < input > output


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.