10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank.
Text file :
... (2 Replies)
Discussion started by: fspalero
2. UNIX for Dummies Questions & Answers
Edit: Figured it out. Close the thread please.
edit by bakunin: no need to close the thread, but i changed the title to SOLVED. Thanks for writing a follow-up. (0 Replies)
Discussion started by: unknownn
3. Shell Programming and Scripting
I have a file that has data something like below:
.....and so on
I am trying to bring it in one line with comma delimited something like below :
I tried the something below in the code section:
cat File.txt | tr '\n' ',' (1 Reply)
Discussion started by: rkumar28
4. UNIX for Dummies Questions & Answers
I need help removing the last character of every line if it is a certain character. For example I need to get rid of a % character if it is in the last position.
Output should be:
I tried this but it gets rid of all of the % characters.... (5 Replies)
Discussion started by: raptor25
5. UNIX for Dummies Questions & Answers
I need to remove square brackets from output of script.
and I need to remove the square brackets so I am lett with
121 Is sed the only means to do this and if so what are the options?
...ok so far I have managed to get rid of ] by using /usr/bin/sed 's/]//' but that... (5 Replies)
Discussion started by: rob171171
6. Shell Programming and Scripting
I have a file like this:
I need to remove the 1 after the . in the file name so that it reads:
Having some difficulty getting the command to work. I tried using
cut -d 26
but that just doesn't work. (3 Replies)
Discussion started by: bbbngowc
7. Shell Programming and Scripting
If I have a string defined as:
How can I loop through it character by character? I haven't been able to find a way to index the string so that I loop through it.
shew01 (10 Replies)
Discussion started by: shew01
8. Shell Programming and Scripting
I have a variable in the form of '/example/file.txt' . I want to remove the ' characters from the beginning and the end so that the my new variable becomes /example/file.txt . How can I do it in a script?
I know this is a fairly easy question, but i wasn't able to implement it. (3 Replies)
Discussion started by: sertansenturk
9. UNIX for Advanced & Expert Users
While writing a shell script i happen to store some value in a string. Lets say the value is 59788.
Now in this script i want to get the value 9788 removing the first charater 5. The original string length usually remains constant.
Is there a single line command to do this or any simple way to... (4 Replies)
Discussion started by: npn
10. UNIX for Dummies Questions & Answers
I am attempting to remove all the ^M characters in a file in VI.
The command I am using is
but it doesn't work, saying 'substitute pattern match failed'.
Any ideas why?
Jules (2 Replies)
Discussion started by: julesinbath