Search Results

Search: Posts Made By: tintin72
47,073
Posted By tintin72
works like a dream! Many thanks!
works like a dream! Many thanks!
47,073
Posted By tintin72
Using awk to find and use the maximum value in column of data
Dear Unix Gurus,

I have a text file with multiple columns, for example, see sample.txt below

0 1 301
1 4 250
2 6 140
3 2 610
7 1 180I want to find the maximum in, say, column 3,...
2,001
Posted By tintin72
Great! It works. Many thanks!!
Great! It works. Many thanks!!
2,001
Posted By tintin72
Convert nxm Matrix into columns of data
Dear Unixers,

I'm having some difficulty in converting an n x m data matrix into a dataset of 3 columns and nxm rows. As an example I want to convert this dataset


2 3 4 5
2 ...
1,901
Posted By tintin72
Thanks guys. my problem is a little bit...
Thanks guys.
my problem is a little bit complicated because my datafile contains hundreds of rows, so I couldn't possibly create a blank file and fill it up by hand as suggested by joeyg. But your...
1,901
Posted By tintin72
Enter data at end of a file
Hi All,

I have a sample datafile:


5.1
5.2
0.8
6.1


What I want to do is create an additional 3 rows with the number "0.7". so that I now have:


5.1
5.2
0.8
6.1
0.7
0.7
2,343
Posted By tintin72
Hi, I want to insert a pre-defined number,...
Hi,

I want to insert a pre-defined number, i.e. in this case "-999.99", into all blank rows.

The reason for this is that I want to use the datafile to generate histograms - one for each data...
2,343
Posted By tintin72
Insert text in datafile with uneven columns
Dear Unix Gurus,

I have a dataset consisting of a number of uneven columns. What I would like to do is fill up the missing rows with an arbitrary text of fixed value so that all columns now have...
22,582
Posted By tintin72
Thanks guys, Your answers worked except for...
Thanks guys,

Your answers worked except for the answer given by gaurav1086


awk '!/SCAN/{print}' in_file


your script prints all lines not containing the word SCAN! I think that...
22,582
Posted By tintin72
Using awk/sed to extract text between Strings
Dear Unix Gurus,

I've got a data file with a few hundred lines (see truncated sample)...


BEGIN_SCAN1
TASK_NAME=LA48 PDD Profiles
PROGRAM=ArrayScan
1.00 21.220E+00
2.00 ...
3,761
Posted By tintin72
Hi, I revisited it too and scratched my...
Hi,

I revisited it too and scratched my head as well! There's a bug in the script...if firstslice is bigger than lastslice it won't work. So I've tried a different tack using awk.

as a...
3,761
Posted By tintin72
doesn't work. can I just ask..did you actually...
doesn't work. can I just ask..did you actually try out your suggestions bufore suggesting them to the forum?
3,761
Posted By tintin72
I'm not sure I understand you. Doing echo...
I'm not sure I understand you. Doing echo "$zposition" |bc returns the correct output. But doing echo "sl$[n]_z$[zposition].txt" does not. This is my problem.
3,761
Posted By tintin72
Using Floating Numbers in String
Dear Unix Gurus,

I have a list of files that I want to loop over....for example:

sl40_z11.70.txt
sl41_z11.40.txt
sl42_z11.10.txt
sl43_z10.80.txt


using the script


#!/bin/sh
#...
6,401
Posted By tintin72
Great! thanks guys! :D:D
Great! thanks guys! :D:D
6,401
Posted By tintin72
convert matrix to row and columns
Dear Unix Gurus,

I have a sample data set that looks like this


y1 y2 y3 y4 y5
x1 0.3 0.5 2.3 3.1 5.1
x2 1.2 4.1 3.5 1.7 1.2
x3 3.1 2.1 1.0 4.1 2.1
x4 5.0 4.0 6.0 7.0 1.1
I...
66,441
Posted By tintin72
thanks.
thanks.
66,441
Posted By tintin72
nice! it works. thanks
nice! it works.

thanks
66,441
Posted By tintin72
doesn't work. my screen hangs.
doesn't work. my screen hangs.
66,441
Posted By tintin72
use AWK to read an Environment variable
Dear Unix gurus,

Perhaps I'm missing something,.....I'm having the most infernal difficulty getting AWK to read in an environment variable. For example,


value=5
awk '{print ""$value""}'
...
7,619
Posted By tintin72
$FILE. it makes no difference either way. I've...
$FILE. it makes no difference either way. I've just tried running the script as a file with the inputfile path set to $file and it worked.
7,619
Posted By tintin72
hello cfajohnson, Yes, I have $FILE set to...
hello cfajohnson,

Yes, I have $FILE set to my inputfile path. It still hangs. your script syntax isn't quite right it seems or perhaps it has something to do with my shell? I use bash. $(cat <...
7,619
Posted By tintin72
Thanks guys! The solutions by Krabu and...
Thanks guys!

The solutions by Krabu and Vidyadhar85 worked nicely. The x and y I put in for clarity, the original datafile contains only numbers. your solutions works for either case.

The...
7,619
Posted By tintin72
selective concatenation of rows & columns
Dear unix gurus,

I have a data file that looks something like this ...


x y x y x y x y x y
0 3836 30 3915 60 5984 90 7388 120 8385...
10,590
Posted By tintin72
it worked. thanks.:b:
it worked. thanks.:b:
Showing results 1 to 25 of 33

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