10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi I was hoping someone could help me with a sed script I am trying to write? I am on a Mac running ElCapitan
I have some text that I have converted from a pdf that I want to format into an xml file.
In the file I have managed to delete all the text I do not need. The text I have left is... (8 Replies)
Discussion started by: Paul Walker
8 Replies
2. Shell Programming and Scripting
In the awk below I am trying to output those lines that Match between file1 and file2, those Missing in file1, and those missing in file2. Using each $1,$2,$4,$5 value as a key to match on, that is if those 4 fields are found in both files the match, but if those 4 fields are not found then missing... (0 Replies)
Discussion started by: cmccabe
0 Replies
3. UNIX for Dummies Questions & Answers
Dear all,
I have a file call test.txt which has 2000 columns, 1000 rows. If I want to trim all the columns to 3 decimal places, how can I do it? I know how to use awk prinf to trim specic columns. But I don't know how to trim all the columns. Thank you.
data sample:
0.976004565 9.34567845... (6 Replies)
Discussion started by: forevertl
6 Replies
4. Shell Programming and Scripting
Hi,
I have one input file which is delimited by pipe. I want to put decimal points in this input file at particular position in particular column and also get the negative sign (if any) at start of that column.
$ cat Input_file.txt
11|10102693|1|20151202|10263204|20151127|N|0001... (7 Replies)
Discussion started by: Prathmesh
7 Replies
5. UNIX for Dummies Questions & Answers
Dear all,
I have a data test.txt as below.
X22.30799720_T cg03868770 -0.5645412582127 2.4084685750406e-175
X22.30781182_A cg03868770 -0.5620426397492 3.5818034129169e-172
X22.30780724_C cg03868770 -0.5616890165605 2.9765569717858e-168
what I want is:
X22.30799720_T cg03868770... (3 Replies)
Discussion started by: forevertl
3 Replies
6. Shell Programming and Scripting
Hi to all,
May someone help me with the following.
The awk script below is part of a bigger awk script, and this part attempts to print an Ip address that is in hex format in decimal format. I'm trying with following code but
I'm getting 0.0.0.0 and the correct answer is 192.168.140.100
... (9 Replies)
Discussion started by: Ophiuchus
9 Replies
7. Shell Programming and Scripting
Hi,
I have an issue converting decimal places of a particular column, i am using below script to get the output, but the output is not generating in desired format.
awk -F"," 'BEGIN{OFS=","}{if(NR==0)getline;if ($7 != "") {if ($7 > 0) $7=$7/100 ; {printf "%.2f"... (3 Replies)
Discussion started by: rramkrishnas
3 Replies
8. Shell Programming and Scripting
Hi, I am trying to do something like this ...
I use awk to match a pattern, and then print out all col.
My code is :
awk '{if ($1 ==300) print $1,$2-'$sbin7',$3}' tmp.txt
output=
300 2
whereby sbin7=2,
The thing is, I want to print all col and row, not just the matched line/row only, but... (10 Replies)
Discussion started by: horsepower
10 Replies
9. Shell Programming and Scripting
Hi folks,
I have a text file that I need to parse, and I cant figure it out. The source is a report breaking down softwares from various companies with some basic info about them (see source snippet below). Ultimately what I want is an excel sheet with only Adobe and Microsoft software name and... (5 Replies)
Discussion started by: rowie718
5 Replies
10. Shell Programming and Scripting
i am trying to add numbers with decimal place and I am prompted with an error.
this expr command works
:add=`expr 1 + 1`
:echo $add
:2
but when i am trying to add
:addThis=`expr 1.1 + 1`
:expr: An integer value was expected.
is there a way to add numbers with decimal place in UNIX? (4 Replies)
Discussion started by: tads98
4 Replies