473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to remove .000 from 1000.000 using grep command?

Hi in my file im having value like
cpu speed is 1000.000

but i wants to pick only before special character .(dot) please help me someone ? thanks in advance
Mar 5 '11 #1
1 2161
sicarie
4,677 Expert Mod 4TB
Sounds like you need a regex (regular expression).

Are you familiar with the command-line utilities awk or sed? Or possibly a scripting language like PERL or Python?

Those all offer regular expression functionality and PERL and Python are usually contained in most base installs (awk and sed are almost always in command-line utilities).

From there, I'd suggest something with a group. Groups are usually noted through parentheses - what you set to catch in between the parentheses will be caught. You could do (1000) in your script to test, and then catch something like ([0-9]+)\.

If I remember my regexes correctly, that will capture any group of numbers before a period (a dot is a special character in a regex and needs to be 'escaped' to catch the dot symbol).

Here are some links that might help
awk - http://www.gnu.org/software/gawk/manual/gawk.html
sed - http://www.gnu.org/software/sed/
PERL - http://www.perl.org/docs.html
Python - http://www.python.org/doc/
Mar 7 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Kevin | last post by:
Hi All, I am new to MS SQL Server.I am using MS SQL 2000.I have a problem in creating a table by using Select command.I have table called "test" and i want to create another table with the same...
0
by: Nitin Gaur | last post by:
Hi, I am developing an application using Visual Studio .NET in C++. I am using following command to automate the debugging of this executable: devenv -command Debug.StepInto myProg.cpp...
3
by: NK | last post by:
Hello, I am a beginner of DB2 and I am in a trouble that I can't access to sample database. Please see below. ENV : OS AIX-5.2/ DB2 8.1.2 SYMPTOM: I don't have any DB2 client terminal so...
3
by: Apollo440 | last post by:
How to remove unused using directive? eg) using System; using System.Windows.Forms; <- i want to remove this unused using directive namespace foo { :
0
by: den 2005 | last post by:
Hi everybody, I am not familiar using Gridview, I created a Gridview with Edit Command Button, but when I click the update Command button this error message below is displayed, what and where is...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
0
by: teckguan | last post by:
Hi everyone, I would like to ask how am I going to execute multiple scripts using UNIX command? I have found a command to execute. However, I cannot execute it. The command is db2 -txf <<EOF...
0
debasisdas
by: debasisdas | last post by:
Using Merge command (supported version 9 onwards) ======================================== Used to go for insert/update in a single command based on some condition. Example #1 merge...
5
by: progvar | last post by:
Hi all, i want to create the backup of sql 6.0 database using sql command i used this command BACKUP DATABASE test TO DISK = 'E:\test.Bak' but it shows the error Msg 156, Level 15, State 1...
2
by: powerfulperl | last post by:
I want to locate a string 'Local=IN' from a file and I am sure that this string is located within 100 lines(assumption) from the beginning of the file out of 5000 lines. The 100th line start with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.