10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
when given a file name, im looking for the most efficient way to turn each letter of the file name into spaces.
for instance, the way im thinking of going about this is this:
MYFILE=check_disks.sh
CHANUM=$(echo ${MYFILE} | awk '{ print length }')
printf '%s\n' $CHANUM
as you can see... (4 Replies)
Discussion started by: SkySmart
4 Replies
2. Shell Programming and Scripting
Hi,
Need to sort file based on the number of delimeters in the lines.
cat testfile
/home/oracle/testdb
/home
/home/oracle/testdb/newdb
/home/oracle
Here delimeter is "/"
expected Output:
/home/oracle/testdb/newdb
/home/oracle/testdb
/home/oracle
/home (3 Replies)
Discussion started by: Sumanthsv
3 Replies
3. Shell Programming and Scripting
I seem to have hit a curious problem where sed and awk based regex do not seem to work. Perhaps I am missing a switch to look within the same line and not across lines.
I have input as follows:
... (4 Replies)
Discussion started by: jamie_123
4 Replies
4. Shell Programming and Scripting
Dear All,
fileName: therm.txt
nc3h7o2h 7/27/98 thermc 3h 8o 2 0g 300.000 5000.000 1390.000 41
1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14 2
-2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05 3
... (7 Replies)
Discussion started by: linuxUser_
7 Replies
5. Shell Programming and Scripting
Hi,
I need help to split any lines that contain ; or ,
input.txtAc020 Not a good chemical process
AC030 many has failed, 3 still maintained
AC040 Putative; epithelial cells
AC050 Predicted binding activity
AC060 rodC Putative; upregulated in 48;h biofilm vs planktonic
The output... (8 Replies)
Discussion started by: redse171
8 Replies
6. Shell Programming and Scripting
awk '/abc/{print $2}'
This will show the line contains abc and only show the "two filed"
But I want to the line contains "abc" will only show $2, other line still show.
and I want to know awk's way about not only show the line besides changed line
Thanks (2 Replies)
Discussion started by: yanglei_fage
2 Replies
7. Shell Programming and Scripting
Hi All
I've a file which is similar to the one given below
column1 coulmn2 column3 column4
A B C D
X Y
F G H
I would like to get it in this format
A|B|C|D
||X|Y
F||G|H
Is... (4 Replies)
Discussion started by: Celvin VK
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is.
I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies
9. Shell Programming and Scripting
hello,
i have a file "TEST" and want to change the digit(s) after "=" . but i also want to print the old entry with a comment (for information).
i want to use "sed", is it possible ?
file:
TEST = 10 # comment default value: 0
sed , with "p" , i can print the old entry, but i want to... (2 Replies)
Discussion started by: bora99
2 Replies
10. Shell Programming and Scripting
Hi all,
I have this input file ..
BSS01 107 Swafieh 11/06/2008 12:06:57
BSS01 111 Ramada_Hotel 12/06/2008 11:37:20
BSS01 147 Kalha_Rep 11/06/2008 19:13:39
BSS01 147 Kalha_Rep ... (9 Replies)
Discussion started by: yahyaaa
9 Replies