Sponsored Content
Special Forums UNIX Desktop Questions & Answers awk a integer and replace it minus X Post 302582204 by boaz733 on Thursday 15th of December 2011 05:53:31 AM
Old 12-15-2011
awk a integer and replace it minus X

hey, i have a list of devices that looks like so:

Code:
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(358271365120608989UL))),Option<ulong>())))),2098560),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(650586938465599244UL))),Option<ulong>())))),2098560),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(22574479957500438UL))),Option<ulong>())))),4195200),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(93913043472124733UL))),Option<ulong>())))),4195200),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(217131279596132951UL))),Option<ulong>())))),4195200),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(303655871981484697UL))),Option<ulong>())))),4195200),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(392171455982529305UL))),Option<ulong>())))),8390400),

i m trying to awk the size and reduce 5 MB from each line like so:

Code:
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(358271365120608989UL))),Option<ulong>())))),2098555),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(650586938465599244UL))),Option<ulong>())))),2098555),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(22574479957500438UL))),Option<ulong>())))),4195195),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(93913043472124733UL))),Option<ulong>())))),4195195),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(217131279596132951UL))),Option<ulong>())))),4195195),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(303655871981484697UL))),Option<ulong>())))),4195195),
VolumeTask(DeviceName(DeviceName(DeviceNameInfo(MultiPathType_UID(Option<GUDeviceID>(GUDeviceID(ulonglong(392171455982529305UL))),Option<ulong>())))),8390195),

i tried a few ways but none of them worked perhaps awk is not the way to go
please advise
thank u.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk or grep for integer only

how do you print the lines that contain integers only, using grep or awk? thanks , apalex ------------------ this file below: qwerty 01234 asdfgh 01234 qwer12 asdf05 will be: 01234 01234 qwer12 asdf05 (5 Replies)
Discussion started by: apalex
5 Replies

2. Shell Programming and Scripting

Replace floating-point by integer in awk

Hi, I am trying to write a script to extract multiple sets of data from a chemistry output file. The problem section is in the following format... Geometry "geometry" -> "geometry" 1 Pd 46.0000 -0.19290971 0.00535260 0.02297606 2 P ... (7 Replies)
Discussion started by: smadonald1
7 Replies

3. UNIX for Dummies Questions & Answers

Add comma to integer using AWK

Srr for being pain her let say i have a data in a file like this 1@1000 2@2000 4@4000 5@7770 6@8998 7@80008 i am a newbie in Unix i need to add a comma to integer using AWK function. for example, 1,000 or 80,008 how can i do that ps. i'm using bash shell (1 Reply)
Discussion started by: Nutter
1 Replies

4. Shell Programming and Scripting

awk returns an integer?

I need to extract a value from a text file into a ksh script, and change the last two letters to "00". awk gets the right value (2500 in this example), but the variable has no value. I use the following command: StartTime=expr nawk 'NR==20 {print $11;exit}' $New_FILE echo 1 $StartTime... (4 Replies)
Discussion started by: Iliklev
4 Replies

5. Programming

I don't know how to replace input char with appropriate integer

Hi guys, I asked for help on programming forums and no one didn't helped me so I ask for help here. I am playing with some tasks from my book and I can't figure where did I get wrong. From the first program I get a blank screen, program won't generate 10*10 matrix. And second problem is I... (6 Replies)
Discussion started by: solaris_user
6 Replies

6. Shell Programming and Scripting

Calculating an integer with awk

I would like to extract a number from $0 and calculate if it can be devided by 25. Though the number can also be less then 25 or bigger than 100. How do i extract the number and how can the integer be calculated? String: "all_results">39</span>I am looking for the number between "all_results"> ... (5 Replies)
Discussion started by: sdf
5 Replies

7. Shell Programming and Scripting

sed help, Find a pattern, replace it with same text minus leading 0

HI Folks, I'm looking for a solution for this issue. I want to find the Pattern 0/ and replace it with /. I'm just removing the leading zero. I can find the Pattern but it always puts literal value as a replacement. What am I missing?? sed -e s/0\//\//g File1 > File2 edit by... (3 Replies)
Discussion started by: SirHenry1
3 Replies

8. Shell Programming and Scripting

awk to add plus or minus to fields and split another field

In the tab-delimited input below I am trying to use awk to -10 from $2 and +10 to $3. Something like awk -F'\t' -v OFS='\t' -v s=10 '{split($4,a,":"); print $1,$2-s,$3+s,a,$5,$6} | awk {split(a,b,"-"); print $1,$2-s,$3+s,b-s,b+s,$5,$6}' input should do that. I also need to -10 from $4... (2 Replies)
Discussion started by: cmccabe
2 Replies

9. Shell Programming and Scripting

Need help on awk to compare only integer on particular column

Hi, 0.23 2.94% 0.00 0.00% 17.8G 55.7% 19.6G 40.9% 630 0.00% 0.06 0.77% - - 7524M 22.9% 15.6G 32.6% - - From the above sample output. I need to compare whether the 6th field is more than 10G..if so print the entire line. Here the 6th field is memory TIA (5 Replies)
Discussion started by: Sumanthsv
5 Replies

10. UNIX for Beginners Questions & Answers

Replace integer string in a variable based on month?

Hi Folks - Linux Version = Linux 2.6.39-400.128.17.el5uek x86_64 I have a process that determines the start and end load periods for an Oracle data load process. The variables used are as follows follows: They are populated like such: However, the load requires the month to be the... (11 Replies)
Discussion started by: SIMMS7400
11 Replies
FPIT(4)                                                      Kernel Interfaces Manual                                                      FPIT(4)

NAME
fpit - Fujitsu Stylistic input driver SYNOPSIS
Section "InputDevice" Identifier "idevname" Driver "fpit" Option "Device" "devpath" ... EndSection DESCRIPTION
fpit is an Xorg input driver for Fujitsu Stylistic Tablet PCs. The fpit driver functions as a pointer input device, and may be used as the X server's core pointer. SUPPORTED HARDWARE
This driver supports the touchscreen of the Stylistic LT and (with special options) of the Stylistic 500, 1000, 1200, 2300, and 3400. Mod- ern FinePoint MP800 devices will also work with this driver. Under Linux the Fujitsu's serial port is not, by default, detected. Therefore the port must be configured manually as described in the accompanying readme.txt file. For example, add the following to your startup scripts for Stylistic xx00 devices: setserial /dev/ttyS3 autoconfig setserial /dev/ttyS3 IRQ 15 baud_base 115200 port 0xfce8 This driver now supports Stylistic 3400 (and possibly other passive-pen systems) with a special "Passive" paramter. Try this serial config- uration for the 3400: setserial /dev/ttyS3 autoconfig setserial /dev/ttyS3 uart 16450 irq 5 port 0xfd68 CONFIGURATION DETAILS
Please refer to xorg.conf(5x) for general configuration details and for options that can be used with all input drivers. This section only covers configuration details specific to this driver. The device supports the following options: Option "MaximumXPosition" "number" Sets the maximum X position, use this to calibrate your touchscreen's right hand edge. Option "MinimumXPosition" "number" Sets the minimum X position, use this to calibrate your touchscreen's left hand edge. Option "MaximumYPosition" "number" Option "MinimumYPosition" "number" Same as for X axis, but for Y axis. Option "InvertX" Option "InvertY" Invert the specified axis. Option "SwapXY" Swap the X and Y axis (after inversions). Option "Rotate" "CW" Option "Rotate" "CWW" Manipulate the invert and swap options to match screen rotations. (Will behave strangely if combined with invert or swap options.) New users should consider the "TrackRandR" option instead. Option "DeviceName" "name" Option "DeviceName" "name" sets the name of the X device. Option "AlwaysCore" "on" enables the sharing of the core pointer. When this feature is enabled, the device will take control of the core pointer (and thus will emit core events) and at the same time will be able, when asked so, to report extended events. You can use the last available integer feedback to control this feature. When the value of the feedback is zero, the feature is disabled. The fea- ture is enabled for any other value. Option "DebugLevel" number sets the level of debugging info reported. Option "BaudRate" "38400", "19200" (default) or "9600" changes the serial link speed. Option "Passive" decodes the passive pen. Option "TrackRandR" automatically keeps the cursor synchronized with the pen's position, even when the screen is resized or rotated. (Recommended for tablet PC's.) Example, for Stylistic LT setup is: Section "InputDevice" Identifier "mouse0" Driver "fpit" Option "Device" "/dev/ttyS3" # Option "TrackRandR" EndSection And for other Stylistic devices try: Section "InputDevice" Identifier "mouse0" Driver "fpit" Option "Device" "/dev/ttyS3" Option "BaudRate" "19200" Option "MaximumXPosition" "6250" Option "MaximumYPosition" "4950" Option "MinimumXPosition" "130" Option "MinimumYPosition" "0" Option "InvertY" # Option "TrackRandR" EndSection For Stylistic 3400: Section "InputDevice" Identifier "mouse0" Driver "fpit" Option "Device" "/dev/ttyS3" Option "BaudRate" "9600" Option "MaximumXPosition" "4070" Option "MaximumYPosition" "4020" Option "MinimumXPosition" "0" Option "MinimumYPosition" "0" Option "Passive" Option "SendCoreEvents" # Option "TrackRandR" EndSection SEE ALSO
Xorg(1), xorg.conf(5), Xserver(1), X(7). AUTHORS
Original FPIT port: Rob Tsuk <rob@tsuk.com> and John Apfelbaum <johnapf@linuxslate.com> X4 Port: Richard Miller-Smith <richard.miller-smith@philips.com>, based on Elographics code from: Patrick Lecoanet X4.2 Cleanup: Alan Cox X Version 11 xf86-input-fpit 1.3.0 FPIT(4)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy