Quantcast
Channel: SCN : All Content - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 7030

To remove LF(line feeder) from last line in target file.

$
0
0

Hi PI Experts,

 

I am working on Receiver FCC, where i need to place a target file in an Unix server.

By default target file will get LF(line feeder) at the end of each line, but my requirement is not to populate LF for the last line.


Please find the below screen shot of sample target file

SampleFile.png


I have tried giving below shell commands in processing tab of communication channel


  1. sed -i '$s/..$//' file.txt
  2. sed '/^$/d'  file.txt
  3. $ sed 's/^ *//; s/ *$//; /^$/d; /^\s*$/d' file.txt > output.txt

   4.   sed '${/^$/d;}' file.txt

  3.    sed '/^\s*$/d' file.txt

 

but it is not working.

CommChannel.png

Please help me out.

 

Thanks in advance.

 

Thank you,

Chakradhar N


Viewing all articles
Browse latest Browse all 7030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>