How to change a number on a specific lines in a file with shell?
Hello
My problem is that I want to change some specific numbers in a file. It is like,
The number I want to edit is the number after FBO which is the 11th column in the header string.
(Ex: 2009 10 5 0705 27.2 L 40.477 29.166 5.5 FRO 7 0.7 1.2LFRO 2.4CFRO 1.3LMAM1)
All I need is to add 1.3 to that number. The line number between the blank lines vary.
I create two file one with "FRO number" and one with "FRO number+1.3" And tried to replace them with sed command.
but since the values repeated several time it went all the way wrong so that idea of mine became useless.
Any help would be appreciated...
Last edited by Corona688; 03-09-2012 at 11:46 AM..
Reason: Code tags for code please.
I have a file with contents as follows
Record 1: Rejected - Error on table "DWO"."P2G_CUST_EVENTS".
ORA-00001: unique constraint (DWO.CUST_EVENTS_PK) violated
Record 5: Rejected - Error on table "DWO"."P2G_CUST_EVENTS".
ORA-00001: unique constraint (DWO.CUST_EVENTS_PK) violated
Record 6:... (5 Replies)
Hi
I want to extract certain text between two line numbers like
23234234324 and
54446655567567
How do I do this with a simple sed or awk command?
Thank you.
---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ----------
found it:
sed -n '#1,#2p'... (1 Reply)
hi
My problem now is that if shipping options as -o length = 88
it says the following:
# lp -o length=88 -dhp4015 /etc/hosts
UX:lp: ERROR: The following options can't be handled:
-o length=
TO FIX: The printer(s) that otherwise qualify
for printing your request can't handle
one or more of... (2 Replies)
E.g. the file is like this:
I want to delete all lines that begin with a number larger than 2, ignoring the lines that doesn't begin with a number!
PS:'2' is actually a variable that can have a lot of values:b:i bet you got it (10 Replies)
Hi Gurus,
I am working with a korn shell script to simplify some operations of calculation number of lines inside compressed file.
The called function (inside a cycle) is the following:
#########################################
# F.ne: CheckCount
#########################################... (3 Replies)
hello!
I am trying to use sed to copy specific set of lines from a file for which the starting and ending line numbers of the lines to be copied are stored in shell variables. How can i copy those lines?
if the input_file is something like this
and if the following is the script
a=2
b=4... (4 Replies)
I would like to replicate the functionality of chsh (or passwd -e) by awk.
This is what I got so far, but I think there should be an easier way to search and replace field $7 only for lines beginning with user_name:
awk -v user_name="$user_name" -v new_shell="$new_shell" -F: '$1 == user_name {... (2 Replies)
Hello all,
I need to change a number in a file by adding some residuals respectively
To make it clear,
I need to add 0.11 to the number between 24-28 (which is below the SECON) for all the lines starting with FRR1
or I need to add 0.13 to the number between 24-28 (which is below the... (9 Replies)
hi Guys,
this is my requirement, there is a huge xml file of this i have to change 3 lines with out opening the file
/users/oracle > cat lnxdb-pts-454.xml|egrep "s_virtual|s_cluster|s_dlsnstatus"
<cluster_port oa_var="s_clusterServicePort">9998</cluster_port>
<host... (2 Replies)
This could be a really dummy question.
I have a log text file.
What unix command to extract line from specific string to another specific string.
Is it something similar to?:
more +/"string" file_name
Thanks (4 Replies)
Discussion started by: aku
4 Replies
LEARN ABOUT DEBIAN
update-gap-workspace
UPDATE-GAP-WORKSPACE(1) User Commands UPDATE-GAP-WORKSPACE(1)NAME
update-gap-workspace - manage a GAP workspace.
SYNOPSIS
update-gap-workspace
update-gap-workspace update
Create or update the GAP workspace.
update-gap-workspace delete
Delete the GAP workspace.
DESCRIPTION
At start up, GAP load all libraries and packages available on the system. This take several seconds. To save time, GAP can store the
result of this initialisation in a `workspace'. update-gap-workspace help to manage such workspaces. update-gap-workspace can be run as
root to manage the system-wide workspace. update-gap-workspace can be run as a normal user. In this case the workspace is stored in
$HOME/gap/workspace.gz.
Note that you need to rebuild the workspace each time GAP packages are added, removed or updated. To automate that task, if the system-wide
workspace exists, it is automatically updated whenever a GAP-related Debian package is installed or upgraded.
The gap script will automatically load such workspace at start up.
FILES
/var/lib/gap/workspace.gz:
The system-wide GAP workspace.
$HOME/gap/workspace.gz:
The user-specific GAP workspace.
SEE ALSO gap(1), The `SaveWorkspace' function in the GAP manual.
AUTHOR
Bill Allombert <ballombe@debian.org>
NOTES
We are considering enabling the system-wide workspace per default, though this feature could be too confusing for old-time GAP users. If
you have opinions about it, please mail <gap@packages.debian.org>.
Debian July 2003 UPDATE-GAP-WORKSPACE(1)