10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Below is the file
DISK-A 109063.2 49 31 40.79
DISK-B 110058.5 49 44 57.07
DISK-c 4402.4 2 1 2.14
from the file, i want to search for 'DISK-A' and print only that line with the first word matching to DISK-A and the output should skip DISK-A.
Desired Output: (If i'm... (2 Replies)
Discussion started by: web2moha
2 Replies
2. Shell Programming and Scripting
Hello Team,
i have a file test1.txt, in which i have to grep only the 6 digit number from it,
Could you pls help in this.
$cat test1.txt
<description>R_XYZ_1.6 r370956</description>
$ grep "\{6\}" test1.txt
<description>R_XYZ_1.6 r370956</description>
i need output as 370956.
... (3 Replies)
Discussion started by: chandana hs
3 Replies
3. Shell Programming and Scripting
I want to write/print a number through a shell script up to its last significant digit (LSD) after the decimal point.
Say,
x=10.00056000000000000
I want to print x as x=10.00056.
Note that x can be any thing so I cannot know the position of the LSD always.
Thanks. (16 Replies)
Discussion started by: hbar
16 Replies
4. Shell Programming and Scripting
Hi,
I'm trying to acheive the following, I have a dat file in which i have several addresses, If the address starts with a single digit then i have to delete the line,
if it starts with 2 or more digits then i have to keep the line
Here is a sample of my file:
377 CARRER DE LA... (5 Replies)
Discussion started by: ramky79
5 Replies
5. Shell Programming and Scripting
Have columns with digits and strings like:
input.txt
3840 3841 3842 Dav Thun Tax
Cahn 146; Dav.
3855 3853 3861 3862 Dav Thun Tax
2780 Karl VI.,
3873 3872 3872 Dav Thun Tax
3894 3893 3897 3899 Dav Thun Tax
403; Thun 282.
3958 3959 3960 Dav Thun Tax
3972 3972 3972 3975 Dav Thun Tax... (8 Replies)
Discussion started by: sdf
8 Replies
6. Shell Programming and Scripting
Hi ,
how to add the single digit to front of the word and front of the lines in the one file with compare pattern file and get digit. like example
pattern file pattern.txt
pattern num
bala 2
raja 3
muthu 4
File Name: chennai.dat
muthu is good boy
raja is bad boy
selvam in super... (6 Replies)
Discussion started by: krbala1985
6 Replies
7. Shell Programming and Scripting
Hi all,
I have a two files ... the first file contain "ls -la " output on directory. second file contains " ls -la " output on the same directory but after removing some files from the directory.... how to get the file names that are removed ....... the total no of files are more than 1000 so... (2 Replies)
Discussion started by: firestar
2 Replies
8. UNIX for Dummies Questions & Answers
I have this code that loops through a directory and adds all the files it finds in a log file.
# get list of files from FTP server; stores
# 'ls -l' results in $FTP_RESULTS
(
echo user ${FTP_USER} ${FTP_PASSWD}
echo cd ${FULL_PATH}
echo ls -l
echo bye
)|ftp -i -n... (3 Replies)
Discussion started by: akabir77
3 Replies
9. UNIX for Dummies Questions & Answers
I have a script like this--
#!/bin/ksh
echo "To pad a 0 before digits from 1-9"
for i in $*
do
echo $i | sed 's//'0'/g'
done
I run this script as
ksh name 1 2 23 34
The output should be
01 02 23 34
Help me in modifying this script.
Thanks
Namish (2 Replies)
Discussion started by: namishtiwari
2 Replies
10. Shell Programming and Scripting
How to print all lines that has exactly 3 occurences of digit 4 using grep?
I am able to find the pattern if it is for atleast 3 occurences but with exactly 3 occurences? Can anybody help me on this. (3 Replies)
Discussion started by: sivasai83
3 Replies