Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Copying part of a data file into another Post 302829991 by latsyrc on Sunday 7th of July 2013 05:45:09 PM
Old 07-07-2013
Copying part of a data file into another

Hi,
I have a large number of data files each containing simple integers from 1 to around 25000 in ascending order. However, they are not in a specific progression; some numbers are missing in each file.
For ex. datfile1 may have the numbers in order 1 2 4 6 7 8 12 ... 24996 24999
while datfile2 may have them in order 1 3 5 6 8 9 ... 24999 25000

For each data file, I want to create a new one which has only the integers greater than 16000.
For ex. newdatfile1 may have numbers 16001 16003 16004 ... 24996 24999

The problem is I know very little about UNIX. So, any help will be highly appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying some part of file

Hey friends, Here I am with another query. I have a TXT file. Foe an example EX ID : B-Mezine .... ... ... Some lines of text (Not fixed in length n no of lines).. ... ... .. END EX ID Some blank lines in between two records(Not fixed in numbers) EX ID : B-Mezine .... ...... (20 Replies)
Discussion started by: anushree.a
20 Replies

2. Shell Programming and Scripting

Copying data from excel file

Hii friends, I am a newbie to unix/shell scripting and got stuck in implementing a functionality.Dear experts,kindly spare some time to bring me out of dark pit :confused:.. My requirement is somewhat wierd,let me explain what i have and what i need to do... 1) there are several excel... (1 Reply)
Discussion started by: 5ahen
1 Replies

3. UNIX for Dummies Questions & Answers

How to get data only inside polygon created by points which is part of whole data from file?

hiii, Help me out..i have a huge set of data stored in a file.This file has has 2 columns which is latitude & longitude of a region. Now i have a program which asks for the number of points & based on this number it asks the user to enter that latitude & longitude values which are in the same... (7 Replies)
Discussion started by: reva
7 Replies

4. Programming

Doubt in C programming (copying data from one file to another)

Hello, i'm new to the forum and so am i to C programming. Recently i've gotten a task to create a program that will read an existing .bin file and copy the data to a non existing (so i have to create it) .txt file (some type of conversion) Now, i now how to put the arguments, opening and... (5 Replies)
Discussion started by: Lyric
5 Replies

5. Programming

SQL: copying data down

I have a series of observations of which one column is sometimes missing (zero): date temp delta 1977 284.54 29.84 1978 149.82 0 1979 320.71 28.45 1980 176.76 0 1981 854.65 0 1984 817.65 0 1985 990.58 27.98 1986 410.21 0 1987 405.93 0 1988 482.9 0 What I would like to achieve is a... (8 Replies)
Discussion started by: figaro
8 Replies

6. Shell Programming and Scripting

Copying data from files to directories

I have the following that I'd like to do: 1. I have split a file into separate files that I placed into the /tmp directory. These files are named F1 F2 F3 F4. 2. In addition, I have several directories which are alphabetized as dira dirb dirc dird. 3. I'd like to be able to copy F1 F2 F3 F4... (2 Replies)
Discussion started by: newbie2010
2 Replies

7. Solaris

Copying data from one file server to another

Hello people, I have a question regarding transferring data from one file server to another. The server is a Solaris 9 box The old file server is connected via Ethernet cable, and the new file server we are switching is a Fiber channel. can I use the dd if=server:/app1 of=server2:/app1 ... (2 Replies)
Discussion started by: br1an
2 Replies

8. UNIX for Dummies Questions & Answers

Renaming files with part of their pathname and copying them to new directory

Hi I think this should be relatively simple but I can't figure it out. I have several files with the same name in different folders within a directory (the output of a program that I ran). Something like this: ./myAnalysis/item1/round1/myoutput.txt ./myAnalysis/item1/round2/myoutput.txt... (2 Replies)
Discussion started by: jullee
2 Replies

9. Programming

SQL: copying data up

I need to fix an SQL statement in MySQL that should calculate a field using values from two of the columns and I prefer to do this using set-based programming, ie not procedural. What needs to happen is that in a separate column called "delta" the value of "level" is copied depending on whether... (3 Replies)
Discussion started by: figaro
3 Replies

10. UNIX for Beginners Questions & Answers

Grep a section from an UNIX file obtaining only part of the data

Hello, I have a log file that has several sections "BEGIN JOB, End of job" like in the following example: 19/06/12 - 16:00:57 (27787398-449294): BEGIN JOB j1(27787398-449294) JOB1 19/06/12 - 16:00:57 (27787398-449294): DIGIT: 0 number of present logs : 1 19/06/12 - 16:00:57... (4 Replies)
Discussion started by: mvalonso
4 Replies
TERM(5) 							File Formats Manual							   TERM(5)

NAME
term - format of compiled term file. SYNOPSIS
term DESCRIPTION
Compiled terminfo descriptions are placed under the directory /usr/share/terminfo. In order to avoid a linear search of a huge UNIX system directory, a two-level scheme is used: /usr/share/terminfo/c/name where name is the name of the terminal, and c is the first character of name. Thus, act4 can be found in the file /usr/share/terminfo/a/act4. Synonyms for the same terminal are implemented by multiple links to the same compiled file. The format has been chosen so that it will be the same on all hardware. An 8 or more bit byte is assumed, but no assumptions about byte ordering or sign extension are made. The compiled file is created with the tic program, and read by the routine setupterm. The file is divided into six parts: the header, ter- minal names, boolean flags, numbers, strings, and string table. The header section begins the file. This section contains six short integers in the format described below. These integers are(1) the magic number (octal 0432); (2) the size, in bytes, of the names section; (3) the number of bytes in the boolean section; (4) the number of short integers in the numbers section; (5) the number of offsets (short integers) in the strings section; (6) the size, in bytes, of the string table. Short integers are stored in two 8-bit bytes. The first byte contains the least significant 8 bits of the value, and the second byte con- tains the most significant 8 bits. (Thus, the value represented is 256*second+first.) The value -1 is represented by the two bytes 0377, 0377; other negative values are illegal. This value generally means that the corresponding capability is missing from this terminal. Note that this format corresponds to the hardware of the VAX and PDP-11 (that is, little-endian machines). Machines where this does not corre- spond to the hardware must read the integers as two bytes and compute the little-endian value. The terminal names section comes next. It contains the first line of the terminfo description, listing the various names for the terminal, separated by the `|' character. The section is terminated with an ASCII NUL character. The boolean flags have one byte for each flag. This byte is either 0 or 1 as the flag is present or absent. The capabilities are in the same order as the file <term.h>. Between the boolean section and the number section, a null byte will be inserted, if necessary, to ensure that the number section begins on an even byte (this is a relic of the PDP-11's word-addressed architecture, originally designed in to avoid IOT traps induced by addressing a word on an odd byte boundary). All short integers are aligned on a short word boundary. The numbers section is similar to the flags section. Each capability takes up two bytes, and is stored as a little-endian short integer. If the value represented is -1, the capability is taken to be missing. The strings section is also similar. Each capability is stored as a short integer, in the format above. A value of -1 means the capabil- ity is missing. Otherwise, the value is taken as an offset from the beginning of the string table. Special characters in ^X or c nota- tion are stored in their interpreted form, not the printing representation. Padding information $<nn> and parameter information %x are stored intact in uninterpreted form. The final section is the string table. It contains all the values of string capabilities referenced in the string section. Each string is null terminated. Note that it is possible for setupterm to expect a different set of capabilities than are actually present in the file. Either the data- base may have been updated since setupterm has been recompiled (resulting in extra unrecognized entries in the file) or the program may have been recompiled more recently than the database was updated (resulting in missing entries). The routine setupterm must be prepared for both possibilities - this is why the numbers and sizes are included. Also, new capabilities must always be added at the end of the lists of boolean, number, and string capabilities. Despite the consistent use of little-endian for numbers and the otherwise self-describing format, it is not wise to count on portability of binary terminfo entries between commercial UNIX versions. The problem is that there are at least three versions of terminfo (under HP-UX, AIX, and OSF/1) which diverged from System V terminfo after SVr1, and have added extension capabilities to the string table that (in the binary format) collide with System V and XSI Curses extensions. See terminfo(5) for detailed discussion of terminfo source compatibility issues. As an example, here is a hex dump of the description for the Lear-Siegler ADM-3, a popular though rather stupid early terminal: adm3a|lsi adm3a, am, cols#80, lines#24, bel=^G, clear= 32$<1>, cr=^M, cub1=^H, cud1=^J, cuf1=^L, cup=E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K, home=^^, ind=^J, 0000 1a 01 10 00 02 00 03 00 82 00 31 00 61 64 6d 33 ........ ..1.adm3 0010 61 7c 6c 73 69 20 61 64 6d 33 61 00 00 01 50 00 a|lsi ad m3a...P. 0020 ff ff 18 00 ff ff 00 00 02 00 ff ff ff ff 04 00 ........ ........ 0030 ff ff ff ff ff ff ff ff 0a 00 25 00 27 00 ff ff ........ ..%.'... 0040 29 00 ff ff ff ff 2b 00 ff ff 2d 00 ff ff ff ff ).....+. ..-..... 0050 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 0060 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 0070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 0080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 0090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 00a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 00b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 00c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 00d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 00e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 00f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 0100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 0110 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........ ........ 0120 ff ff ff ff ff ff 2f 00 07 00 0d 00 1a 24 3c 31 ....../. .....$<1 0130 3e 00 1b 3d 25 70 31 25 7b 33 32 7d 25 2b 25 63 >..=%p1% {32}%+%c 0140 25 70 32 25 7b 33 32 7d 25 2b 25 63 00 0a 00 1e %p2%{32} %+%c.... 0150 00 08 00 0c 00 0b 00 0a 00 ........ . Some limitations: total compiled entries cannot exceed 4096 bytes. The name field cannot exceed 128 bytes. FILES
/usr/share/terminfo/*/* compiled terminal capability data base SEE ALSO
curses(3X), terminfo(5). TERM(5)
All times are GMT -4. The time now is 09:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy