Search Results

Search: Posts Made By: garethsays
5,858
Posted By garethsays
awk empty fields
Hello

I have a file like this

a,b,c,1,2,3,d,e,f,,,,g,h,i,,,,j,k,l

and using awk 'FS="'"{print $9,$10,$11}' does not work as I was hoping. I would like the empty fieds, i.e. between the two...
1,246
Posted By garethsays
awk command to return only field with a number in it
What is an awk command to print only fields with a number in it??

Input file.......
S,S,S,S,S,S,S,S,S
001S,S,S,S,S,S,S,S,S
00219S,23S,24S,43S,47S,S,S,S,S
00319S,10S,23S,41S,43S,47S,S,S,S...
1,324
Posted By garethsays
Parallel processing
I have 10,000 + files, each of which I need to zip using bzip2.

Is ti possible to use bash to create 8 parallel streams sending a new file to be processed from the list when one of the others has...
1,236
Posted By garethsays
Use bash command on awk field and output the result
Hello, I want to run a field from an awk command through a command in bash.

For example my input file is

1,2,3
20,30,40
60,70,80

I want tot run $2 thought the command
date +%d/%m/%y...
1,393
Posted By garethsays
Gnuplot 3d binning
Hello

I have a text file with tens of thousands of rows
The format is
x y

where both x and y can be anything between -100 and +100.

What I would like to do is have a 3d gnuplot where there...
1,396
Posted By garethsays
awk problem
Hi

I have two columns and I would like to create a third column based on how many lines away from a value of 1 in column 2,

for example I have

1,0
2,0
3,0
4,0
5,0
6,1
7,0
8,0
9,0...
1,304
Posted By garethsays
Simple awk script needed
but I'm stumped...please help

I have a file like this.......

1000 1 34
1000 10 34
1000 11 35
1000 20 35
1000 21 36
1000 30 36
2000 1 34
2000 10 34
...
2,197
Posted By garethsays
Output only first 400 bytes of a huge text file
How do I output only the first 400 bytes of a huge text file to a new file.

It has to be unmodified so no added invisible characters.

Many thanks.....
4
BC
1,637
Posted By garethsays
BC
Spent ages on this and given up.....any bright ideas?

I would like an expression that if input -3 to -24, will give -27 to -48
and if input is -27 to -48, will give -3 to -24
i.e......
INPUT ...
5,666
Posted By garethsays
How do I do this for multiple lines??? So...
How do I do this for multiple lines???

So if Input is

1 2 000060000
1 2 060000000
1 2 006000000

Output

1 2 5
1 2 2
1 2 3
5,666
Posted By garethsays
awk index
1 2 000060000

How do i return the point in the string where the 6 is?

i.e what I want on output is
1 2 5

something like awk '{print $1 $2 index($3,6) }'
but I can't get it to work...
1,014
Posted By garethsays
perl help please
@newline = split(' ',$line);
$stream = index ($newline[15],("1","2"))+1;

where newline[15] is a series of 0 with either a 1 or 2, e.g 00010000000 or 020000000000.

$stream will let me know...
Forum: Red Hat 07-22-2010
14,223
Posted By garethsays
stty size dows not give the answer I...
stty size dows not give the answer I expect....when I make a terminal window full size I get 66 237
Where I expect the screen resolution of 1200 800

Any other ideas??
Forum: Red Hat 07-22-2010
14,223
Posted By garethsays
terminal size
Is there an easy command to know the size of a terminal window from a command line command?
12,109
Posted By garethsays
Done
Anyone interested here is my script.

#!/bin/bash
cd ~/tst2
## set variable year_dir as first year
year_dir=2007

## checks dir exists and is a directory and into FIRST LOOP
while [ -d...
12,109
Posted By garethsays
Tony The perl script you wrote does almost...
Tony

The perl script you wrote does almost exactly as wanted, it's just the rename command that does not work with no error message.

Can't seem to see why, I've opened up permissions etc but...
12,109
Posted By garethsays
bash script to rename multiple directories
Hello

I have a directory structure with year in format 4 digits, e.g 2009, below which is month format 1 or 2 digits, e.g 1 or 12, blow which is day format 1 or 2 digits, e.g 1 or 31.

I want...
Forum: Linux 06-12-2009
13,013
Posted By garethsays
install vlc on acer aspire one linpus linux
hello friends

i have tried follwoing the instructions

efore you proceed to install VLC you may want remove the pre-installed media players.

sudo yum remove pdvdlinux mplayer\*
sed...
5,980
Posted By garethsays
awk getline
How do you make the getline function return to the original line?
The example below should make it clear where I am currently going wrong.

Thanks

AWK SCRIPT:
-------------
awk -F '-' '{...
1,900
Posted By garethsays
here is my attempt...a very ugly script and not...
here is my attempt...a very ugly script and not very portable but seems to do the job now.....
thanks for your input....all sorted now....thanks

fold input_file| egrep "^ [0-2]" > tides1
nl...
1,900
Posted By garethsays
scripting help with bash and awk
I'm trying to reformat some tide information into a useable format and failing.
Input file is....

4452 CHENNAI (MADRAS)
13°06'N, 80°18'E India East Coast 01 June 2009 UT(GMT)
Data Area 3....
1,381
Posted By garethsays
so far....
awk '{a=$1;b=$2;getline;c=$2;print a,c}' input_file

which gives me an output from my original input file of

a d
e h

and I was expecting
a d
c f
e h

Any ideas???

Thanks
1,381
Posted By garethsays
awk help
I have a file

a b
c d
e f
g h

and I want output

(a-d) (b-c)
(c-f) (d-e)
(e-h) (f-g)

I have tried using the awk getline command but I always seem to skip a line.

Thanks
1,775
Posted By garethsays
modifications
What I meant to say was that foo2 does not have any Record Seperator.

awk '{print NR}' foo1
returns an answer of 1

The attached file is the printout to screen using the fold command.
1,775
Posted By garethsays
awk help - input vales from on efile to annother
Please see attached test file for better explanation and formatting of files....thanks

foo1

H2600 LINE:
H2600
H2600
H2600 MYSystems Ltd. (Feb 18 2009)
V1760R1130 1 ...
Showing results 1 to 25 of 28

 
All times are GMT -4. The time now is 05:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy