Sponsored Content
Full Discussion: awk - change variable on fly
Top Forums UNIX for Dummies Questions & Answers awk - change variable on fly Post 302627691 by haczyk on Saturday 21st of April 2012 09:13:18 AM
Old 04-21-2012
1. this might be sample input file:
Code:
"aaaaa","bbbbbb","ccccc","ddddd,eeeee","ffffff","ggggg","3","2012/02/22 12:25:21","2012/02/22 00:00:00","8","hhhh","iiii"
"aaaaa","bbbbbb","ccccc","ddddd,eeeee","ffffff","ggggg","2","2012/02/22 12:25:21","2011/02/22 00:00:00","8","hhhh","iiii"
"aaaaa","bbbbbb","ccccc","ddddd,eeeee","ffffff","ggggg","2","","2010/02/22 00:00:00","8","hhhh","iiii"
"aaaaa","bbbbbb","ccccc","ddddd,eeeee","ffffff","ggggg","1","2012/02/22 12:25:21","2009/02/22 00:00:00","8","hhhh","iiii"

2. no order. only a lots of records (at least 40 MB) Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to change awk and shell variable value?

In awk script, #!/bin/sh awk 'BEGIN{i=0;}{i=i+5;}END{print i}' in.txt vr=0; vr=$i; echo "$vr" How can i assign that value of i in $vr(variable) of shell script? (7 Replies)
Discussion started by: cola
7 Replies

2. Shell Programming and Scripting

Change only the name of a variable

if I have a variable named z inside a java file, is there any way to globally change the name of the variable and all its occurences as a variable? (but not any other z that is not part of that variable name) (3 Replies)
Discussion started by: lydiaflamp
3 Replies

3. Shell Programming and Scripting

awk: change string variable

Hi. How to change string variable in awk? for example, I parse with awk script text file named some_name_with_extension.txt I want to print only some_name in my script .... varCompName = FILENAME print varCompName How to put not all symbols from FILENAME to variable? thank you This... (4 Replies)
Discussion started by: cintlt
4 Replies

4. Shell Programming and Scripting

Store Host lookup in variable ("on the fly")

Hi, I'm new here. I was wondering why I can't store a host lookup in a variable. for line in $(< blacklist) do STOREIP=host $line; if ]; then $line >> blacklist2; else $line >> blacklist3; fi done Result: "ip" command not found .. so how would I store the host lookup in the... (2 Replies)
Discussion started by: sOliver
2 Replies

5. Shell Programming and Scripting

using awk for setting variable but change the output of this variable within awk

Hi all, Hope someone can help me out here. I have this BASH script (see below) My problem lies with the variable path. The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level. The... (6 Replies)
Discussion started by: Cowardly
6 Replies

6. Shell Programming and Scripting

Change the filename variable value

Hi guys, I have a variable where i am storing the filename (with full path). I just need the value before ".txt". But instead of getting the filename i am getting the contents of the filename. FileName=/appl/data/Input/US/Test.txt a=`awk -F"." '{print $1}' ${FileName}` echo $a... (3 Replies)
Discussion started by: mac4rfree
3 Replies

7. Shell Programming and Scripting

Change Variable Value from Multiple Scripts and Use these Variable

Hi to All, Please find below details. file_config.config export file1_status="SUCCESS" export file2_status="SUCCESS" file_one.sh I am calling another two shell script from these script. I need to pass individual two script status (If it's "FAILED") to file_main.sh. file_main.sh I... (2 Replies)
Discussion started by: div_Neev
2 Replies

8. Shell Programming and Scripting

I can't change the value of my variable!

I made this HEADMAKER variable to pull the header from the first file in the loop, but then to stop so it doesn't override the file with later loops. However, I CANNOT get it to reassign the value of my variable away from "FIRST". I have also tried it with 1 and 0, and with and without quotes and... (3 Replies)
Discussion started by: crankymonkey
3 Replies

9. UNIX for Dummies Questions & Answers

Change variable value

I have big XML which i want to change all VERSIONNUMBER equal to 1,in existing file values of VERSIONNUMBER will be different as below now i want to change all VERSIONNUMBER values qual to 1.Please help me which will convert versionnumber values. <SHORTCUT OBJECTSUBTYPE ="" OBJECTTYPE ... (5 Replies)
Discussion started by: katakamvivek
5 Replies

10. Shell Programming and Scripting

Make change to variable value inside of awk script

Hello, I have text data that looks like this, Mrv16a3102061815532D 6 6 0 0 0 0 999 V2000 -0.4018 1.9634 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.1163 1.5509 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.1163 0.7259 ... (9 Replies)
Discussion started by: LMHmedchem
9 Replies
sccsfile(4)                                                        File Formats                                                        sccsfile(4)

NAME
sccsfile - format of an SCCS history file DESCRIPTION
An SCCS file is an ASCII file consisting of six logical parts: checksum Character count used for error detection. delta table Log containing version info and statistics about each delta. usernames Login names and/or group IDs of users who may add deltas. flags Definitions of internal keywords. comments Arbitrary descriptive information about the file. body the Actual text lines intermixed with control lines. Each section is described in detail below. Conventions Throughout an SCCS file there are lines which begin with the ASCII SOH (start of heading) character (octal 001). This character is here- after referred to as the control character, and will be represented as `^A'. If a line described below is not depicted as beginning with the control character, it cannot do so and still be within SCCS file format. Entries of the form ddddd represent a five digit string (a number between 00000 and 99999). Checksum The checksum is the first line of an SCCS file. The form of the line is: ^A hddddd The value of the checksum is the sum of all characters, except those contained in the first line. The ^Ah provides a magic number of (octal) 064001. Delta Table The delta table consists of a variable number of entries of the form: ^As inserted/deleted/unchanged ^Ad type sid yr/mo/da hr:mi:se username serial-number predecessor-sn ^Ai include-list ^Ax exclude-list ^Ag ignored-list ^Am mr-number ... ^Ac comments ... ... ^Ae The first line (^As) contains the number of lines inserted/deleted/unchanged respectively. The second line (^Ad) contains the type of the delta (normal: D and removed: R), the SCCS ID of the delta, the date and time of creation of the delta, the user-name corresponding to the real user ID at the time the delta was created, and the serial numbers of the delta and its predecessor, respectively. The ^Ai, ^Ax, and ^Ag lines contain the serial numbers of deltas included, excluded, and ignored, respectively. These lines do not always appear. The ^Am lines (optional) each contain one MR number associated with the delta. The ^Ac lines contain comments associated with the delta. The ^Ae line ends the delta table entry. User Names The list of user-names and/or numerical group IDs of users who may add deltas to the file, separated by NEWLINE characters. The lines con- taining these login names and/or numerical group IDs are surrounded by the bracketing lines ^Au and ^AU. An empty list allows anyone to make a delta. Flags Flags are keywords that are used internally (see sccs-admin(1) for more information on their use). Each flag line takes the form: ^Af flag optional text The following flags are defined in order of appearance: ^Af t type-of-program Defines the replacement for the %T% ID keyword. ^Af v program-name Controls prompting for MR numbers in addition to comments. If the optional text is present, it defines an MR number validity checking program. ^Af i Indicates that the `No id keywords' message is to generate an error that terminates the SCCS command. Otherwise, the message is treated as a warning only. ^Af b Indicates that the -b option may be used with the SCCS get command to create a branch in the delta tree. ^Af m module-name Defines the first choice for the replacement text of the %M% ID keyword. ^Af f floor Defines the "floor" release, that is, the release below which no deltas may be added. ^Af c ceiling Defines the "ceiling" release, that is, the release above which no deltas may be added. ^Af d default-sid The d flag defines the default SID to be used when none is specified on an SCCS get command. ^Af n The n flag enables the SCCS delta command to insert a "null" delta (a delta that applies no changes) in those releases that are skipped when a delta is made in a new release (for example, when delta 5.1 is made after delta 2.7, releases 3 and 4 are skipped). ^Af j Enables the SCCS get command to allow concurrent edits of the same base SID. ^Af l lock-releases Defines a list of releases that are locked against editing. ^Af q user-defined Defines the replacement for the %Q% ID keyword. ^Af e 0|1 The e flag indicates whether a source file is encoded or not. A 1 indicates that the file is encoded. Source files need to be encoded when they contain control characters, or when they do not end with a NEWLINE. The e flag allows files that contain binary data to be checked in. Comments Arbitrary text surrounded by the bracketing lines ^At and ^AT. The comments section typically will contain a description of the file's pur- pose. Body The body consists of text lines and control lines. Text lines do not begin with the control character, control lines do. There are three kinds of control lines: insert, delete, and end, represented by: ^AI ddddd ^AD ddddd ^AE ddddd respectively. The digit string is the serial number corresponding to the delta for the control line. SEE ALSO
sccs-admin(1), sccs-cdc(1), sccs-comb(1), sccs-delta(1), sccs-get(1), sccs-help(1), sccs-prs(1), sccs-prt(1), sccs-rmdel(1), sccs-sact(1), sccs-sccsdiff(1), sccs-unget(1), sccs-val(1), sccs(1), what(1) SunOS 5.10 30 Sep 2002 sccsfile(4)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy