Sponsored Content
Top Forums Shell Programming and Scripting Modifying data within the same line Post 302435201 by Xterra on Tuesday 6th of July 2010 05:16:29 PM
Old 07-06-2010
Modifying data within the same line

My file looks like this
Quote:
;1.0
26;27;30;39;45;46;47;48;51;54;55;56;57;58;59;60;61;62;63;64;65;66;68;69;71;72;73;74;76;77;78;80;82;8 3;84;85;86;87;88;89;90;91;93;94;95;96;97;98;99;102;103;104;105;106;107;108;109;110;114;115;116;119;1 20;121;124;133;136;141;145;147;150;151;157;
10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;1 0;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10 ;10;10;10;10;10;10;
>GHXCZCC01AJ9EA Freq 59;1;;;;
GTCTGGACCCGGGGCGAGGCTGTCGCGCCGGTTTCATGCCCGCGTCTCCCACCGTGCGGCTGCAGGTTATAAA
>GHXCZCC01ANKKF Freq 33;1;;;;
GTCTGGACCCGGGGCGAGGCTGTCGCGCCGGTTTCATGCCCGCGTCTCCCACCGTGCGGCTGCAGGTTATAGA
>GHXCZCC01AQARH Freq 22;1;;;;
GTCTGGACCCGGGGTGAGGCTGTCGCGCCGGTTCCCTGCCCGCGTCTCCCACCATGCGGCTGCAGGTTATAGA
>GHXCZCC01AL97H Freq 21;1;;;;
GTCTGGACCCGGGGTGAGGCTGTCGCGCCGGTTTCATGCCCGCGTCTCCCACCGTGCGGCTCCAGGTTATAGA
>GHXCZCC01AO1HG Freq 313;1;;;;
GTCTGGACCCGGGGCGAGGCTGTCGCGCCGGTTCCCTGCCCGCGTCTCCCACCATGCGGCTGCAGGTTATAGA
But I need to move the frequency value (Freq) to the second position, leaving intact the numbers at the top. The resulting file should look like this
Quote:
;1.0
26;27;30;39;45;46;47;48;51;54;55;56;57;58;59;60;61;62;63;64;65;66;68;69;71;72;73;74;76;77;78;80;82;8 3;84;85;86;87;88;89;90;91;93;94;95;96;97;98;99;102;103;104;105;106;107;108;109;110;114;115;116;119;1 20;121;124;133;136;141;145;147;150;151;157;
10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;1 0;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10;10 ;10;10;10;10;10;10;
>GHXCZCC01AJ9EA ;59;;;;
GTCTGGACCCGGGGCGAGGCTGTCGCGCCGGTTTCATGCCCGCGTCTCCCACCGTGCGGCTGCAGGTTATAAA
>GHXCZCC01ANKKF ;33;;;;
GTCTGGACCCGGGGCGAGGCTGTCGCGCCGGTTTCATGCCCGCGTCTCCCACCGTGCGGCTGCAGGTTATAGA
>GHXCZCC01AQARH ;22;;;;
GTCTGGACCCGGGGTGAGGCTGTCGCGCCGGTTCCCTGCCCGCGTCTCCCACCATGCGGCTGCAGGTTATAGA
>GHXCZCC01AL97H ;21;;;;
GTCTGGACCCGGGGTGAGGCTGTCGCGCCGGTTTCATGCCCGCGTCTCCCACCGTGCGGCTCCAGGTTATAGA
>GHXCZCC01AO1HG ;313;;;;
GTCTGGACCCGGGGCGAGGCTGTCGCGCCGGTTCCCTGCCCGCGTCTCCCACCATGCGGCTGCAGGTTATAGA
Thanks in advance!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

compare data line by line from a file

Hi there How can I compare data line by line from a file? I need to compare the second value with the fourth to know if they are different. If those values are different, I require to send my first value to the output until the complete file has been read. This is my file: 0 FALSE... (1 Reply)
Discussion started by: loperam
1 Replies

2. Shell Programming and Scripting

Formatting a text file to get data in exact line by line

I have my data something like this SERIAL FIRSTOCCURRENCE NETPROTOCOL 1947430693 07/01/2009 05:16:40 FR SERIAL FIRSTOCCURRENCE NETPROTOCOL 1947430746 07/01/2009 05:18:05 FR I want the output as follows.... (1 Reply)
Discussion started by: rdhanek
1 Replies

3. Shell Programming and Scripting

Modifying a line

Hi, I am having trouble modifying this line. It is because there is a space that I dont know how to deal with. So the file looks like this >YM4911-Contig4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >YM4915-Contig5 MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM There are two spaces between contig#... (6 Replies)
Discussion started by: phil_heath
6 Replies

4. Shell Programming and Scripting

modifying a awk line

Hi, I want to print specific columns (from 201 to 1001). The line that I am using is listed below. However I also want to print column 1. So column 1 and 201 to 1001. What modifcations do I need to make? Code: awk -F'\t' 'BEGIN {min = 201; max = 1001 }{for (i=min; i<=max; i++) printf... (5 Replies)
Discussion started by: phil_heath
5 Replies

5. UNIX for Dummies Questions & Answers

Modifying a particulae data in a line contained in File

Hi, I have a file containing data: systemname/userid/password/comment systemname1/userid1/password1/comment1 systemname2/userid2/password2/comment2 I want to modify the "password" using script. Can anybody help me with this problem?:confused: (2 Replies)
Discussion started by: pgarg1989
2 Replies

6. Shell Programming and Scripting

Searching for a particular string and modifying text within block of data

Hi Forum. Is there a quick way to do the following search/replace within a block of data? I tried to google the solution but didn't really know what to look for. I have the following text file (I want to search for a particular string "s_m_f_acct_txn_daily_a1" and replace the... (5 Replies)
Discussion started by: pchang
5 Replies

7. Shell Programming and Scripting

Help in adding a data after a particular line of data in a file.

Hi.. I'm into a bump after trying to solve this prob.. i've a file with contents like below. <blankline> 'pgmId' : 'UNIX', 'pgmData' : 'textfile', 'author' : 'admin', ....... Now i'm trying to insert a new data after pgmId. so the final output will be... (7 Replies)
Discussion started by: arjun_arippa
7 Replies

8. Shell Programming and Scripting

Modifying file from command line using Perl

Hi all, I am having a slight issue updating a file using perl from the command line I need some help with. The item is: DATA_FILE_TYPE=FULL When I run the below command /usr/bin/perl -p -i -e "s/DATA_FILE_TYPE=/DATA_FILE_TYPE=APPEND/g" processfile.cfg It looks to be... (2 Replies)
Discussion started by: kstevens67
2 Replies

9. Shell Programming and Scripting

Modifying bash script to take each line in a file and execute command

I need to modify a bash script to to take each line in a file and execute command. I currently have this: #!/bin/bash if ; then echo "Lipsa IP"; exit; fi i=1 ip=$1 while ; do if ; then rand=`head -$i pass_file | tail -1` user=`echo $rand | awk '{print $1}'` pass=`echo $rand | awk '{print $2}'`... (3 Replies)
Discussion started by: galford
3 Replies

10. Shell Programming and Scripting

Modifying text file records, find data in one place in the record and print it elsewhere

Hello, I have some text data that is in the form of multi-line records. Each record ends with the string $$$$ and the next record starts on the next line. RDKit 2D 15 14 0 0 0 0 0 0 0 0999 V2000 5.4596 2.1267 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 ... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
BIB-1 ATTRIBUTE SET(7)					   Conventions and miscellaneous				    BIB-1 ATTRIBUTE SET(7)

NAME
bib1-attr - Bib-1 Attribute Set DESCRIPTION
This reference entry lists the Bib-1 attribute set types and values. TYPES
The Bib-1 attribute defines six attribute types: Use (1), Relation (2), Position (3), Structure (4), Truncation (5) and completeness (6). USE (1) 1 Personal-name 2 Corporate-name 3 Conference-name 4 Title 5 Title-series 6 Title-uniform 7 ISBN 8 ISSN 9 LC-card-number 10 BNB-card-number 11 BGF-number 12 Local-number 13 Dewey-classification 14 UDC-classification 15 Bliss-classification 16 LC-call-number 17 NLM-call-number 18 NAL-call-number 19 MOS-call-number 20 Local-classification 21 Subject-heading 22 Subject-Rameau 23 BDI-index-subject 24 INSPEC-subject 25 MESH-subject 26 PA-subject 27 LC-subject-heading 28 RVM-subject-heading 29 Local-subject-index 30 Date 31 Date-of-publication 32 Date-of-acquisition 33 Title-key 34 Title-collective 35 Title-parallel 36 Title-cover 37 Title-added-title-page 38 Title-caption 39 Title-running 40 Title-spine 41 Title-other-variant 42 Title-former 43 Title-abbreviated 44 Title-expanded 45 Subject-precis 46 Subject-rswk 47 Subject-subdivision 48 Number-natl-biblio 49 Number-legal-deposit 50 Number-govt-pub 51 Number-music-publisher 52 Number-db 53 Number-local-call 54 Code-language 55 Code-geographic 56 Code-institution 57 Name-and-title 58 Name-geographic 59 Place-publication 60 CODEN 61 Microform-generation 62 Abstract 63 Note 1000 Author-title 1001 Record-type 1002 Name 1003 Author 1004 Author-name-personal 1005 Author-name-corporate 1006 Author-name-conference 1007 Identifier-standard 1008 Subject-LC-childrens 1009 Subject-name-personal 1010 Body-of-text 1011 Date/time-added-to-db 1012 Date/time-last-modified 1013 Authority/format-id 1014 Concept-text 1015 Concept-reference 1016 Any 1017 Server-choice 1018 Publisher 1019 Record-source 1020 Editor 1021 Bib-level 1022 Geographic-class 1023 Indexed-by 1024 Map-scale 1025 Music-key 1026 Related-periodical 1027 Report-number 1028 Stock-number 1030 Thematic-number 1031 Material-type 1032 Doc-id 1033 Host-item 1034 Content-type 1035 Anywhere 1036 Author-Title-Subject RELATION (2) 1 Less than 2 Less than or equal 3 Equal 4 Greater or equal 5 Greater than 6 Not equal 100 Phonetic 101 Stem 102 Relevance 103 AlwaysMatches POSITION (3) 1 First in field 2 First in subfield 3 Any position in field STRUCTURE (4) 1 Phrase 2 Word 3 Key 4 Year 5 Date (normalized) 6 Word list 100 Date (un-normalized) 101 Name (normalized) 102 Name (un-normalized) 103 Structure 104 Urx 105 Free-form-text 106 Document-text 107 Local-number 108 String 109 Numeric-string TRUNCATION (5) 1 Right truncation 2 Left truncation 3 Left and right truncation 100 Do not truncate 101 Process # in search term . regular #=.* 102 RegExpr-1 103 RegExpr-2 104 Process # ?n . regular: #=., ?n=.{0,n} or ?=.* Z39.58 Thw 105-106 truncation attributes below are only supported by Index Data's Zebra server. 105 Process * ! regular: *=.*, !=. and right truncate 106 Process * ! regular: *=.*, !=. COMPLETENSS (6) 1 Incomplete subfield 2 Complete subfield 3 Complete field SORTING (7) 1 ascending 2 descending Type 7 is an Index Data extension to RPN queries that allows embedding a sort critieria into a query. SEE ALSO
Bib-1 Attribute Set[1] Attibute Set Bib-1 Semantics[2]. NOTES
1. Bib-1 Attribute Set http://www.loc.gov/z3950/agency/defns/bib1.html 2. Attibute Set Bib-1 Semantics http://www.loc.gov/z3950/agency/bib1.html YAZ 4.2.30 04/16/2012 BIB-1 ATTRIBUTE SET(7)
All times are GMT -4. The time now is 08:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy