Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Adding variables to repeating strings Post 302764647 by verse123 on Thursday 31st of January 2013 05:49:04 PM
Old 01-31-2013
sorry im new to this,

so this file has 21,092 lines and around line 5427 this script begins to skip some repeats and doesn't assign a letter. Towards the very bottom of the file there are hardly any repeats being assigned letters. Is there a size limitation to this?

---------- Post updated at 05:49 PM ---------- Previous update was at 05:39 PM ----------

I also noticed that in some cases it jumps letters like in the sample below

Code:
DOG000160 a
DOG000160 b
DOG000161 e
DOG000161 f
DOG000162 b

it's calling DOG000161 "e" instead of "a". And DOG000162 "b" is really supposed to be "a". Why do you suppose this is?

Last edited by Scrutinizer; 01-31-2013 at 07:48 PM.. Reason: quote tags to code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Repeating variables in the code

Hi all, I had written 3 KSH scripts for different functionalities. In all these 3 files there are some 30 variables in common. So I want to reduce the code by placing these variables in a common properties file named (dataload.prop/dataload.parms/dataload.txt) or txt file and access it... (1 Reply)
Discussion started by: mahalakshmi
1 Replies

2. Shell Programming and Scripting

bash hell , removing " and adding from a strings

I'm writing a bash script and i'm stuck the out put of a dialog menu is echo $select "foo" "bar" "lemon" cheese" while I need $foo $bar $lemon $cheese to reuse them as strings later in the script and very new to bash scripting and i've no idea how to do this any help would be... (2 Replies)
Discussion started by: xpd259
2 Replies

3. Shell Programming and Scripting

Adding Strings to a file

Well thanks a lot but I have another Problem I try to solve. I habe one simple Textfile with entries like this, for example: file1 file2 file3 file4 ... file200 And I want to add Strings at the beginning on the line. Like this word1 file1 word1 file2 ... I hope you can help me (3 Replies)
Discussion started by: Blackbox
3 Replies

4. Shell Programming and Scripting

Adding strings to lines in a file

Hi all, I have a positional text file that comes from some source application. Before it is processed by destination application I have to add some header (suffix) to every record(line) in the file. e.g. Actual File ............... AccountDetails AcNO Name Amount 1234 John 26578 5678... (3 Replies)
Discussion started by: sharath160
3 Replies

5. Shell Programming and Scripting

Adding Variables

Hi. I have a for loop that I use to extract integer values in a shell script (ksh). Now, I would like to add the values. My preference, from my c programming days, would be to do something like the commented out line below in the for loop. However, this is not recognised. So I use the line... (2 Replies)
Discussion started by: mikem22
2 Replies

6. Shell Programming and Scripting

AWK adding prefix/suffix to list of strings

75 103 131 133 138 183 197 221 232 234 248 256 286 342 368 389 463 499 524 538 (5 Replies)
Discussion started by: chrisjorg
5 Replies

7. UNIX for Dummies Questions & Answers

Need help with repeating variables in a shell script

I should preface this by saying I have never worked with shell scripts before so this is all new to me. I was able to make something that worked, but is terribly optimized, and I have no idea how to improve it. If anything it's a pretty hilarious script: #/bin/bash get_char() { ... (4 Replies)
Discussion started by: ricco19
4 Replies

8. Shell Programming and Scripting

Script to rename the repeating strings

All, I have a sample text like below. Key (Header) Key1 ABC Key2 ABC Key3 ABC ABC Key4 ABC Key5 ABC ABC ABC Required Output Key (Header) Key1 (2 Replies)
Discussion started by: ks_reddy
2 Replies

9. Shell Programming and Scripting

--Parsing out strings for repeating delimiters for everyline

Hello: I have some text output, on SunOS 5.11 platform using KSH: I am trying to parse out each string within the () for each line. I tried, as example: perl -lanF"" -e 'print "$F $F $F $F $F $F"' But for some reason, the output gets all garbled after the the first fields.... (8 Replies)
Discussion started by: gilgamesh
8 Replies

10. Shell Programming and Scripting

Adding sequential index to duplicate strings

I have a text file in the following format >Homo sapiens KQKCLYNLPFKRNLEGCRERCSLVIQIPRCCKGYFGRDCQACPGGPDAPCNNRGVCLDQY SATGECKCNTGFNGTACEMCWPGRFGPDCLPCGCSDHGQCDDGITGSGQCLCETGWTGPS CDTQAVLPAVCTPPCSAHATCKENNTCECNLDYEGDGITCTVVDFCKQDNGGCAKVARCS... (2 Replies)
Discussion started by: jerrild
2 Replies
TAPECALC(1)						      General Commands Manual						       TAPECALC(1)

NAME
tapecalc - full-screen editing calculator USAGE
tapecalc [options] [file-specifications] SYNOPSIS
Tapecalc is a fixed-point calculator that operates as a full-screen editor. DESCRIPTION
Tapecalc performs fixed-point computation. It is designed for use as a checkbook or expense-account balancing tool. Tapecalc maintains a running result for each operation. You may scroll to any position in the expression list and modify the list. Enter data by typing numbers (with optional decimal point), separated by operators. An output transcript may be saved and reloaded for further editing. Scripts are loaded from left to right (with the "output" processed first). OPTIONS
Command line options of tapecalc are: -h Prints the list of options. -i interval Sets compounding interval for interest computation. -o script Specify file in which to save output transcript. -p num Sets precision (number of digits after the decimal place). OPERATIONS
Computations: The operators are all single-character: + begins an addition - begins a subtraction ~ negates the result * begins a multiplication / begins a division % begins an interest computation (uses interval): rate=number. $ begins a sales-tax computation: rate=number. ( opening parenthesis. This may enclose a unary '-', more parentheses, or data (implicit unary '+'). ) closing parenthesis, expects another operator, not data. = flushes out the current number, forces re-computation of the running result. A space flushes out the current number-input, and (by default) sets the next operator to be the same as the current one. You may repeat the last arithmetic operation of any type: a repeats the last '+' (default 0). s repeats the last '-' (default 0). n repeats the last '~'. m repeats the last '*' (default 1). d repeats the last '/' (default 1). i repeats the last '%' (default 4). t repeats the last '$' (default 4). You may toggle the prefix operator of any number by typing a single character: A toggles the operator to '+'. S toggles the operator to '-'. N toggles the operator to '~'. M toggles the operator to '*'. D toggles the operator to '/'. I toggles the operator to '%'. T toggles the operator to '$'. Editing: As you enter data, you may edit it. A backspace deletes the last digit of the current number (if it is visible). Use the arrow keys or vi-style 'h' and 'l' to move left and right within the line. Other editing commands include u undoes the last x/X command (restricted to restoring the current data only). x deletes the current data. If the data is null, deletes the following line. X deletes the current data. If the data is null, deletes the preceding line and moves up. o opens a new line after the current line. O opens a new line before the current line. # edit the associated comment. An "open" permits you to insert a new operator and data into the expression list. You may type an operator character (e.g., '+'), and continue with the new data, or an operator-repeat (e.g., 'A'). In either case, you may edit the new data, just as you would the old data. A 'u' (or other toggle, such as 'o', 'O', or 'q') typed after an open will undo the open (and close it). Scrolling/cursor movement: H move to the top line on the screen. M move to the middle line on the screen. L move to the last line on the screen CTL/F scroll forward one screen. CTL/B scroll backward one screen. j move forward one line. k move backward one line. z<CR> move the current line to the top of the screen. z. move the current line to the middle of the screen. z- move the current line to the bottom of the screen. Like vi, tapecalc allows you to jump to a particular line with a ":" command :$ jumps to the last entry :1 jumps to the first entry. Scripts: Transcript files are formatted to permit line-oriented entries: <operator><value><tab><ignored><tab># comment The transcripts saved by tapecalc contain the running result in the "ignored" part. To exit without saving a transcript, type 'Q'. A nor- mal exit, by typing 'q', saves the list of operators, data (and running result) in the specified file. You can read and write scripts without leaving tapecalc. reads a script at the current entry :e file clears the current script and reads a script from the file. :f shows the current script name. :r file :w file writes a script to the specified file. ENVIRONMENT
Tapecalc runs in a portable UNIX(R) environment. FILES
Tapecalc is a single binary module, with a help file tapecalc.hlp installed in the same directory. FUTURE WORK
It would be nice to be able to change the precision within the program. In particular, the interest and sales tax computations would be more useful if their precision was independent of the running total. AUTHOR
Thomas Dickey SEE ALSO
wc (1), vi (1) TAPECALC(1)
All times are GMT -4. The time now is 12:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy