10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
We have a requirement of picking nth position value by using cut command. value would be delimited by any symbols. We have to pass delimited value and postition to get the value in a string.
ex.
echo "A,B,C,D,E" |cut -d "," -f3
echo "A|B|C|D|E"|cut -d "|" -f2
Kindly frame the... (5 Replies)
Discussion started by: KK230689
5 Replies
2. Shell Programming and Scripting
There is a text file in my project named as "mom.txt" in which i want to have contents like..................
LSCRM(Application Name):
1: This is my first application.
2: Today we did shell scripting automation for this app.
3: It was really a good fun in doing so.
4: Really good.| (Here i... (7 Replies)
Discussion started by: Abhijeet Anand
7 Replies
3. Shell Programming and Scripting
While looping through a file, I am cutting different length of characters (based on their length) like columns and want to produce the output in a separate file with different columns being separated by a comma.
How to achieve this with an online command. I don't want to create multiple variables... (8 Replies)
Discussion started by: mady135
8 Replies
4. Shell Programming and Scripting
Hello,All
Suppose I have a file like following:
aaa;bbb;ccc
ddd;eee;fffI want the output like:
aaa|bbb|ccc
ddd|eee|fffTo do this, i wrote the code:
awk 'BEGIN{FS=";";OFS="|"} {print}' myfileHowever, the output is still using ; as the delimter. What did I do wrong? Thanks. (5 Replies)
Discussion started by: littlewenwen
5 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I am trying to list the various dates for which the file is available in a directory using the command below, (& subsequently pass the command output to a loop)
Command :
ls dir|grep 'filename'|cut -d '_' -f1|cut -c1-8|tr '\n' ','
However, it is giving me an extra comma... (6 Replies)
Discussion started by: dsfreddie
6 Replies
6. Shell Programming and Scripting
Hi all,
I have a number of strings like below:
//mnt/autocor/43°13'(33")W/
and i'm trying to get the numbers in this string, for example
431333
please help
thanks ahead (14 Replies)
Discussion started by: sunnydanniel
14 Replies
7. Shell Programming and Scripting
Hi,
I've a situation where,
a=xxx.yyy.zzz.txt
EXTN=`echo $a | cut -d . -f2`
Using the above code it delimites and will return "yyy.zzz.txt" to EXTN. But i need to get only the extension "txt". so as per the above code it delimits in the first "." itself. Can anyone help how to do... (6 Replies)
Discussion started by: skcvasanth
6 Replies
8. Shell Programming and Scripting
I have a command that when ran it will have an output such as
string LongerString
string2 longerString2
More MoreStrings
seperated by tabs. The command lists domains and their accounts set up in my server admin software (interworx).
The end result will be that it will run rsync for... (2 Replies)
Discussion started by: sweede
2 Replies
9. UNIX for Advanced & Expert Users
Hi All,
Can the cut command have double character delimiter?
If yes, how can we use it.
if my data file contains :
apple || mango || grapes
i used
cut -f1 -d"||" filename
but got an error.
Plz help....
Thanks. (1 Reply)
Discussion started by: AshishK
1 Replies
10. Shell Programming and Scripting
hello..
my prob is as follows:
i have to read from a file which may have different formats depending upon the delimiter used in the data of the file.now i need that the user input the delimiter.the input delimiter is stored in a variable and is used on cut command to retrieve necessary... (3 Replies)
Discussion started by: tej.buch
3 Replies