05-15-2007
delete some columns
I've got a data file like the following format.
196004010000 196004020000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 314.161773681641
196004020000 196004030000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 314.71533203125
196004030000 196004040000 8192 24 ueaag 98.793 18.750 20 ---- - 36 23 9999 315.208740234375
I need the first and last column as
196004010000 314.161773681641
196004020000 314.71533203125
196004030000 315.208740234375
Would you have any idea to do this job? I'd be grateful with any help.
Many thanks,
su_in99
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I've already posted elsewhere but am posting again here coz im a newbie. I hope you forgive me this time.
I want to know if its possible to delete or ignore columns in a large dataset using 'sed'. For example, I have the following dataset: -
... (0 Replies)
Discussion started by: aarif
0 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I want to know if its possible to delete or ignore columns in a large dataset using 'sed'. For example, I have the following dataset: -
20060714,X.XX,1,043004,Q,T,24.0000,1,25.5000,4,
20060714,X.XX,1,081209,Q,T,24.0000,1,25.5000,5,
As you can see, there are 10 columns here and the... (4 Replies)
Discussion started by: aarif
4 Replies
3. UNIX for Dummies Questions & Answers
Hii I have a file which contains huge amounts of data.I just want to delete last 3 columns in the without changing its format.The file contains data as shown below
PDE 2001 10 29 202148.60 38.92 24.20 33 4.8 MLATH .F. .......
PDE 2001 10 29 203423.57 38.88 24.41 33 3.7 MLATH... (3 Replies)
Discussion started by: reva
3 Replies
4. UNIX for Dummies Questions & Answers
how do I delete the first 3 lines and the first column and the tab?
infile:
Colorspace 0
SA-Sample 1 in 32
FTab-Chars 10
Sequence-1 SINE1_7SL 282
Sequence-2 sapieTTns 289
Sequence-3 7SL_Hopns 289outfile:
SINE1_7SL 282
sapieTTns 289
7SL_Hopns 289Thanks (4 Replies)
Discussion started by: jdhahbi
4 Replies
5. UNIX for Dummies Questions & Answers
I have this space delimited large text file with more than 1,000,000+ columns and about 100 rows. I want to delete all the columns that start with NA such that:
File before modification
aa bb cc NA100 dd
aa b1 c2 NA101 de
File after modification
aa bb cc dd
aa b1 c2 de
How would I... (3 Replies)
Discussion started by: evelibertine
3 Replies
6. Shell Programming and Scripting
Hello Guys
I have a flat file with few thousands of rows.
Now each rows have different number of columns
I want to delete the rows which has not equal to 749 columns
Can you guys please let me know how to do the same
Your help is much appreciated. (2 Replies)
Discussion started by: Pratik4891
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a file like this
a 1 2
b 2 2
c 2 3
d 4 5
f 5 6
output
a 1 2
c 2 3
d 4 5
f 5 6
Basically, I want to delete the whole line if $2 and $3 are the same. Thanks (5 Replies)
Discussion started by: jacobs.smith
5 Replies
8. UNIX for Dummies Questions & Answers
Dear all,
I have one file (see below) with more then 100 columns, and need only column which has GType in label with Alphabets, please help me to remove this columns with numbers.
input file is
n.201.GType n-201.Theta n-201.R n_1.GType n_1.Theta n_1.R n_7.GType ... (1 Reply)
Discussion started by: AAWT
1 Replies
9. Shell Programming and Scripting
Hi,
I'd like to ask for some help with the following task, please:
there is a big file with a header (this is file.in):
NAME A_1.X A_1.Y A_1.Z B_1.X B_1.Y B_1.Z
name1 AB 0.11 0.12 BB 0.45 0.67
name2 BB 0.34 0.56 AA 0.89 0.68
what I need is to recognize a pattern in the header of this... (10 Replies)
Discussion started by: zajtat
10 Replies
10. UNIX for Dummies Questions & Answers
An extension from an earlier question. Now need a sed script to delete columns 7,15 and 16 from an example txt below..
Again, thanks in advance.
98M-01.WAV,98M,01,00:00:49,01:07:36:00,"MIX",,"BOOM-MKH50",,,,,,,,,,"",
98L-01.WAV,98L,01,00:00:51,01:01:45:00,"MIX",,"BOOM-MKH50",,,,,,,,,,"", (7 Replies)
Discussion started by: Vrc2250
7 Replies
LEARN ABOUT DEBIAN
stag-db
STAG-DB(1p) User Contributed Perl Documentation STAG-DB(1p)
NAME
stag-db - persistent storage and retrieval for stag data (xml, sxpr, itext)
SYNOPSIS
stag-db -r person -k social_security_no -i ./person-idx myrecords.xml
stag-db -i ./person-idx -q 999-9999-9999 -q 888-8888-8888
DESCRIPTION
Builds a simple file-based database for persistent storage and retrieval of nodes from a stag compatible document.
Imagine you have a very large file of data, in a stag compatible format such as XML. You want to index all the elements of type person;
each person can be uniquely identified by social_security_no, which is a direct subnode of person
The first thing to do is to build an index file, which will be stored in your current directory:
stag-db -r person -k social_security_no -i ./person-idx myrecords.xml
You can then use the index "person-idx" to retrieve person nodes by their social security number
stag-db -i ./person-idx -q 999-9999-9999 > some-person.xml
You can export using different stag formats
stag-db -i ./person-idx -q 999-9999-9999 -w sxpr > some-person.xml
You can retrieve multiple nodes (although these need to be rooted to make a valid file)
stag-db -i ./person-idx -q 999-9999-9999 -q 888-8888-8888 -top personset
Or you can use a list of IDs from a file (newline delimited)
stag-db -i ./person-idx -qf my_ss_nmbrs.txt -top personset
ARGUMENTS
-i INDEXFILE
This file will be used as the persistent index for storage/retrieval
-r RELATION-NAME
This is the name of the stag node (XML element) that will be stored in the index; for example, with the XML below you may want to use the
node name person and the unique key id
<person_set>
<person>
<id>...</id>
</person>
<person>
<id>...</id>
</person>
...
</person_set>
This flag should only be used when you want to store data
-k UNIQUE-KEY
This node will be used as the unique/primary key for the data
This node should be nested directly below the node that is being stored in the index - if it is more that one below, specify a path
This flag should only be used when you want to store data
-u UNIQUE-KEY
Synonym for -k
-p PARSER
This can be the name of a stag supported format (xml, sxpr, itext) - XML is assumed by default
It can also be a module name - this module is used to parse the input file into a stag stream; see Data::Stag::BaseGenerator for details on
writing your own parsers/event generators
This flag should only be used when you want to store data
-q QUERY-ID
Fetches the relation/node with unique key value equal to query-id
Multiple arguments can be passed by specifying -q multple times
This flag should only be used when you want to query data
-top NODE-NAME
If this is specified in conjunction with -q or -qf then all the query result nodes will be nested inside a node with this name (ie this
provides a root for the resulting document tree)
-qf QUERY-FILE
This is a file of newline-seperated IDs; this is useful for querying the index in batch
-keys
This will write a list of all primary keys in the index
-w WRITER
This format will be used to write the data; can be any stag format (xml, sxpr, itext) - default XML.
Can also be a module that catches the incoming stag event stream and does something with it (for example, this could be a module you write
yourself that transforms the stag events into HTML)
SEE ALSO
Data::Stag
For more complex stag to database mapping, see DBIx::DBStag and the scripts
stag-storenode
selectall_xml
perl v5.10.0 2008-12-23 STAG-DB(1p)