|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 an equal number of rows. for example, in the sample datafile below... Code:
1.0 1.3 0.25 2.2
2.0 1.1 0.25 3.1
3.0 1.2 0.25 2.1
4.0 1.4 0.25 0.1
5.0 1.5 0.25 0.13
8.0 1.7 0.25 0.16
11.5 4.3 0.25 0.1
-11.5 3.3 0.25 0.15
-12.5 4.3 0.25 0.1
-13.5 1.3 0.25 0.3
-14.5 1.4 0.25 0.2
-15.5 1.7 0.25 0.0
3.5 1.3 0.25 0.11
5.5 1.3 0.25 0.13
5.3 0.25 0.15
4.3 0.25 0.17
2.3 0.11
3.3 0.16
1.1
1.4
1.8I would like to fill all the blank rows with -999.99 so I have 4 columns of data, each with 21 rows of text. Inserting an additional column is trivial enough but filling in the blank spaces of an existing column of data with an arbitrary number is beyond me at this time. I need help.....!! ![]() cheers. |
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
how you wanna generate that arbitrary number??
can you elaborate bit more?? |
|
#3
|
|||
|
|||
|
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 column. Problem is the histograms must all have the same number of entries or else my code fails. So I need to insert an arbitrary high number say, 999 or -999 to fill up the blank rows. On generating the histograms I can then select the data I'm interested in using cuts. Cheers |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reversing numbers in a datafile of rows and columns | mattings | Shell Programming and Scripting | 16 | 04-17-2009 08:03 AM |
| Need to insert new text and change existing text in a file using SED | iamgeethuj | Shell Programming and Scripting | 4 | 11-25-2008 02:59 AM |
| How to insert some constant text at beginig of each line within a text file. | Muhammad Afzal | Shell Programming and Scripting | 4 | 10-30-2008 10:01 PM |
| How to insert dummy columns | smolgara | AIX | 2 | 04-19-2008 09:05 AM |
| Combine a datafile with Master datafile, emergent! | onthetopo | Shell Programming and Scripting | 6 | 05-12-2007 06:36 AM |