10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i am passing below inputfils using while loop and ouput should be trim as below
INPUT:
src_SPS_d_Comment_Tran_File_20130417_001.dat
src_SPS_d_Corp_Adv_Tran_File_20130417_001.dat
src_SPS_d_Letter_Tran_File_20130417_001.dat
src_SPS_d_Loan_Level_File_20130417_001.dat... (8 Replies)
Discussion started by: katakamvivek
8 Replies
2. Shell Programming and Scripting
HI,
I have a string "NZ-deploy-mode-1.15-Linux.x86_64.rpm"
I want to get the string before -1 ie "NZ-deploy-mode"
Input is "NZ-deploy-mode-1.15-Linux.x86_64.rpm"
expected output is "NZ-deploy-mode"
How can I do that in shell script?
Thanks in advance. (6 Replies)
Discussion started by: Ananthdoss
6 Replies
3. Shell Programming and Scripting
I am reading a string like $/folder1/folder2/filename from a file
And I am storing it in a variable say $path.
I want to store the path within single quotes in order to use the path within a command.
if i set like path="'"$path"'"
echo $path
It is printing like ' $/folder1/folder2/filename'... (6 Replies)
Discussion started by: Shri123
6 Replies
4. Shell Programming and Scripting
To trim 3rd field in for all the lines of a file and replace the modified string in that particular field.
For example i have a file called Temp.txt having content
Temp.txt
-----------------
100,234,M1234
400,234,K1734
300,345,T3456
----------------
So the modified file output should... (4 Replies)
Discussion started by: rpadhi
4 Replies
5. Programming
I am coding a C program to read a plain text file. There are a lot of blank fields or a string with white spaces. I want to know is there such a function called trim() in C to clean the white space around a string? Or some other way can do this efficiently? Thanks. (18 Replies)
Discussion started by: hxm1303
18 Replies
6. UNIX for Dummies Questions & Answers
Hey Everybody,
I am having much trouble figuring this out, as I am not really a programmer..:mad:
Datafile.txt
Column0 Column1 Column2
ABC DEF xxxGHI
I am running using WGET on a cronjob to grab a datafile, but I need to cut the first three characters from... (6 Replies)
Discussion started by: rickdini
6 Replies
7. Shell Programming and Scripting
Hello,
I am passing a filename to a script to draw parameters from it. However, I want to use part of the filename as a parameter. The filename is transfer_ccf_3731_10.sh but I only need the 3731_10 part of it.
Is this possible? Any help or suggestions would be appreciated!
Regards,
J. (4 Replies)
Discussion started by: JWilliams
4 Replies
8. UNIX for Dummies Questions & Answers
I would like to know how to trim leading zero only in certain column of of a string, example:
hdhshdhdhd000012mmmm0002abc <===== before
hdhshdhdhd 12mmmm 2abc <===== after
Thanks for your help. (2 Replies)
Discussion started by: dngo
2 Replies
9. Shell Programming and Scripting
All
I want to reverse and trim a string using UNIX shell scripts.Iam using Bourne shells. Can you help me? Thanx in advance
Regards
Deepak (5 Replies)
Discussion started by: DeepakXavier
5 Replies
10. Shell Programming and Scripting
I'm trying to find a command that will trim the white space off a string.
e.g.
$str = " stuf "
$str = trim ( $str )
echo $str // ouput would just be stuf
Thanks, Mark (4 Replies)
Discussion started by: msteudel
4 Replies