Sponsored Content
Top Forums Shell Programming and Scripting Removing Space at the end of file Post 64815 by vgersh99 on Wednesday 2nd of March 2005 01:08:59 PM
Old 03-02-2005
Quote:
Originally Posted by rkumar28
Hi....

I have a situation...I have a data file...that has space(an extra row with no data) at the end of file. I am trying to remove that spaces only if the file has a space at the end of file and if there is no space I don't want to do anything.

Can you please help me in this regards.

Thanks
Raj
a sample input with spaces to be deleted marked as '_', pls
and a desired output, pls.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

removing a character and addending to end in each line in a file

HI i am having a file this (sys19:pnlfct:/pfact/temp>) cat temp_sand 1234567890 1234567890 1234567890 1234567890 I want to make this file as (sys19:pnlfct:/pfact/temp>) cat temp_sand 1456789023 1456789023 1456789023 1456789023 just take the 2nd and 3rd position and put it... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

2. UNIX for Dummies Questions & Answers

Removing ^@ character at the end own belowof Linux file

Hi, I have a Linux file which has content as sh (0 Replies)
Discussion started by: bhuvanas
0 Replies

3. UNIX for Dummies Questions & Answers

Removing ^@ chanracter fromthe end of Linux file

Hi, I have a Linux file which has content as shown below 2,Latest Event in RFP_EVENT match Lastest event in Source PRH_RQ_REQUEST,Failed... (3 Replies)
Discussion started by: bhuvanas
3 Replies

4. Shell Programming and Scripting

Add a space at end of file

Hi I guess this is very simple.... I want to add a space at the last line in a file. The space has to be the last charachter on the last line, not at a new line. Anyone ?? (7 Replies)
Discussion started by: disel
7 Replies

5. UNIX for Dummies Questions & Answers

Removing trailing lines at the end of a text file

How do you remove trailing empty lines at the end of a text file? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

6. Shell Programming and Scripting

Removing blank space in file

TT0000013101257 | JCJMMUJMMUB018 ... (0 Replies)
Discussion started by: sususa
0 Replies

7. UNIX for Dummies Questions & Answers

Removing empty lines at the end of a Tab-delimited file

I'm trying to remove all of the empty lines at the end of a Tab delimited file. They have no data just tabs. I've tried may things, here are a couple: sed /^\t.\t/d File1 > File2 sed /^\t{44}/d File1 > File2 What am I missing? (9 Replies)
Discussion started by: SirHenry1
9 Replies

8. Shell Programming and Scripting

Add words in beginning , end after removing a word in a file

My file has the entries like below... /dev/sds /dev/sdak /dev/sdbc /dev/sdbu I want to make the file like below echo 1 > /sys/block/sds/device/rescan echo 1 > /sys/block/sdak/device/rescan echo 1 > /sys/block/sdbc/device/rescan echo 1 > /sys/block/sdbu/device/rescan (2 Replies)
Discussion started by: saravanapandi
2 Replies

9. Shell Programming and Scripting

Gawk --- produce the output in pattern space instead of END space

hi, I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST... (2 Replies)
Discussion started by: busyboy
2 Replies

10. UNIX for Beginners Questions & Answers

Removing pipe and space in a file

Hi , I have a file which is like below. The file record is separated by | as delimiter. I want to remove the first and last | in the file and also I want to remove the spaces in the columns. Original File |3464114 |10 | REPORT|CA| 1|0|4825400|0|213167| 939396524| Expected:... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
tapset::stap_staticmarkers(3stap)										 tapset::stap_staticmarkers(3stap)

NAME
tapset::stap_staticmarkers - systemtap stap_staticmarkers tapset DESCRIPTION
stap.pass0 Starting stap pass0 (parsing command line arguments) See probe::stap.pass0(3stap) for details. stap.pass0.end Finished stap pass0 (parsing command line arguments) See probe::stap.pass0.end(3stap) for details. stap.pass1a Starting stap pass1 (parsing user script) See probe::stap.pass1a(3stap) for details. stap.pass1b Starting stap pass1 (parsing library scripts) See probe::stap.pass1b(3stap) for details. stap.pass1.end Finished stap pass1 (parsing scripts) See probe::stap.pass1.end(3stap) for details. stap.pass2 Starting stap pass2 (elaboration) See probe::stap.pass2(3stap) for details. stap.pass2.end Finished stap pass2 (elaboration) See probe::stap.pass2.end(3stap) for details. stap.pass3 Starting stap pass3 (translation to C) See probe::stap.pass3(3stap) for details. stap.pass3.end Finished stap pass3 (translation to C) See probe::stap.pass3.end(3stap) for details. stap.pass4 Starting stap pass4 (compile C code into kernel module) See probe::stap.pass4(3stap) for details. stap.pass4.end Finished stap pass4 (compile C code into kernel module) See probe::stap.pass4.end(3stap) for details. stap.pass5 Starting stap pass5 (running the instrumentation) See probe::stap.pass5(3stap) for details. stap.pass5.end Finished stap pass5 (running the instrumentation) See probe::stap.pass5.end(3stap) for details. stap.pass6 Starting stap pass6 (cleanup) See probe::stap.pass6(3stap) for details. stap.pass6.end Finished stap pass6 (cleanup) See probe::stap.pass6.end(3stap) for details. stap.cache_clean Removing file from stap cache See probe::stap.cache_clean(3stap) for details. stap.cache_add_mod Adding kernel instrumentation module to cache See probe::stap.cache_add_mod(3stap) for details. stap.cache_add_src Adding C code translation to cache See probe::stap.cache_add_src(3stap) for details. stap.cache_add_nss Add NSS (Network Security Services) information to cache See probe::stap.cache_add_nss(3stap) for details. stap.cache_get Found item in stap cache See probe::stap.cache_get(3stap) for details. stap.system Starting a command from stap See probe::stap.system(3stap) for details. stap.system.spawn stap spawned new process See probe::stap.system.spawn(3stap) for details. stap.system.return Finished a command from stap See probe::stap.system.return(3stap) for details. staprun.insert_module Inserting SystemTap instrumentation module See probe::staprun.insert_module(3stap) for details. staprun.remove_module Removing SystemTap instrumentation module See probe::staprun.remove_module(3stap) for details. staprun.send_control_message Sending a control message See probe::staprun.send_control_message(3stap) for details. stapio.receive_control_message Received a control message See probe::stapio.receive_control_message(3stap) for details. SEE ALSO
probe::stap.pass0(3stap), probe::stap.pass0.end(3stap), probe::stap.pass1a(3stap), probe::stap.pass1b(3stap), probe::stap.pass1.end(3stap), probe::stap.pass2(3stap), probe::stap.pass2.end(3stap), probe::stap.pass3(3stap), probe::stap.pass3.end(3stap), probe::stap.pass4(3stap), probe::stap.pass4.end(3stap), probe::stap.pass5(3stap), probe::stap.pass5.end(3stap), probe::stap.pass6(3stap), probe::stap.pass6.end(3stap), probe::stap.cache_clean(3stap), probe::stap.cache_add_mod(3stap), probe::stap.cache_add_src(3stap), probe::stap.cache_add_nss(3stap), probe::stap.cache_get(3stap), probe::stap.system(3stap), probe::stap.system.spawn(3stap), probe::stap.system.return(3stap), probe::staprun.insert_module(3stap), probe::staprun.remove_module(3stap), probe::staprun.send_control_message(3stap), probe::stapio.receive_control_message(3stap), stap(1), stapprobes(3stap) IBM
--- tapset::stap_staticmarkers(3stap)
All times are GMT -4. The time now is 07:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy