10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have variable named tablename. The value to tablename variable has leading and trailing white spaces. How to remove the leading and training white spaces and write the value of the tablename without space to a file using shell script. ( for e.g. tablename= yyy )
INPUT
... (10 Replies)
Discussion started by: pottic
10 Replies
2. Shell Programming and Scripting
Hi,
I am trying to remove leading and trailing spaces from a file using awk but somehow I have not been able to do it.
Here is the data that I want to trim.
07/12/2017 15:55:00 |entinfdev |AD ping Time ms | .474| 1.41| .581|green |flat... (9 Replies)
Discussion started by: svajhala
9 Replies
3. Shell Programming and Scripting
I'm a newbie to shell scripting.
Can anyone help with the below requirement ?
The leading and trailing date of a files to be removed.
2017-07-12_gmr_tag_log_20170711.csv
2017-07-12_gmr_call_log_20170711.csv
2017-07-12_gmr_outgoing_log_20170711.csv
I'm looking for output like... (7 Replies)
Discussion started by: shivamayam
7 Replies
4. Shell Programming and Scripting
Hi Friends,
I have an input file like this
chr1 100 200 1 2 3 4
chr1 150 200 4 5 6 7
chr2 300 400 9 6 7 1
chr2 300 410 -10 21 -11 13
chr3 700 900 -21 -22 130 165
Now, my output file is
chr1 100 200 1
chr1 150 200 4
chr2 300 400 1
chr2 300 410 10
chr3 700 900 21
Remove... (5 Replies)
Discussion started by: jacobs.smith
5 Replies
5. Shell Programming and Scripting
Does anyone know of a way with C Shell that will work on both Linux and Sun to clear all leading and trailing blanks from a previously specified string? I am using the following code to replace blanks with underscores:
set Company = `echo $Company | sed 's/ /_/g
but I don't want any... (1 Reply)
Discussion started by: phudgens
1 Replies
6. Shell Programming and Scripting
Hi,
I have a file that looks like this:
Jake 2 3 4 6 4 3 -2 -1
Jerry 1 2 3 2 1 7 -6 -1
Timmy -1 -4 -5 -8 9 3 1
I want to find the most positive and negative value for each row and also define its position (based on column #)
So the output would look... (7 Replies)
Discussion started by: gisele_l
7 Replies
7. Shell Programming and Scripting
Hi All,
I have a file with the following contents with multiple lines
172445957| 000005911|8| 400 Peninsula Ave.#1551 | And,K |935172445957|000005911
607573888 |000098536 | 2|Ane, B |J |Ane |1868 |19861206|20090106|20071001
I want to trim the "leading and trailing spaces only" from... (2 Replies)
Discussion started by: kumar04
2 Replies
8. Shell Programming and Scripting
Dear All,
can you please advice how do i remove trailing and leading spaces from a pipe-delimited file using "tr" command
the below cmd, i tried removed all spaces
tr -d ' '<s1.txt>s2.txt1
Many thx
Suresh (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
9. UNIX for Dummies Questions & Answers
I am having xml document as below.
<transactionid>
00
</transactionid>
<tracknumber>
0
</tracknumber>
<key>
N/A
</key>
But the data contains leading and trailing spaces between the tags. Please let me know how can i remove these leading and trailing spaces between the tags.... (2 Replies)
Discussion started by: jhmr7
2 Replies
10. Shell Programming and Scripting
Hi,
how to i remove leading and trailing spaces from a line? the spaces can be behind or in front of any field or line
example of a line in the input data:
Amy Reds , 100 , /bin/sh
how to i get it to be: Amy Read,100,/bin/sh
i saw something on this on the Man pages for AWK... (7 Replies)
Discussion started by: sleepster
7 Replies