Skip to Content
0
Former Member
Apr 09, 2015 at 10:09 AM

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

646 Views

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


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.

Please help me out.

Thanks in advance.

Thank you,

Chakradhar N

Attachments

SampleFile.png (4.0 kB)
CommChannel.png (12.3 kB)