Sponsored Content
Top Forums Shell Programming and Scripting Failure using regex with awk in 'while read file' loop Post 302940538 by Don Cragun on Tuesday 7th of April 2015 03:03:29 AM
Old 04-07-2015
With FS='[=;]', the 1st field on each line in your sample data is the string of characters before the 1st semicolon, the 2nd field is the string barcodelabel, and the 3rd field (referenced in awk by $3) is the string between the equals sign and the 2nd semicolon (which is what you're looking for to match a string read from labels.txt).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read from a file and use the strings in a loop

Hello all, I need some help to create a script which contain a few strings on every line, and use those strings in a loop to fire some commands. for exmaple the file looks like tom dave bill andy paul I want to read one line at a time and use it in loop like command tom command dave... (3 Replies)
Discussion started by: xboxer21
3 Replies

2. UNIX for Dummies Questions & Answers

How to read a file in unix using do....done loop

Hi , can some give me idea about how to use do...done while loop in UNIX to read the contents of a file.. (2 Replies)
Discussion started by: sreenusola
2 Replies

3. Shell Programming and Scripting

How to Read the entire file using while loop

Guys, I am trying to read the whole file using while loop but when i run the ssh part of the script it reads only the first line and exit after that. There are in total 134 lines in the file, but when the output is redirected, it does only for one line and comes to command prompt. pls help..... (11 Replies)
Discussion started by: sdosanjh
11 Replies

4. SCO

file system not getting mounted in read write mode after system power failure

After System power get failed File system is not getting mounted in read- write mode (1 Reply)
Discussion started by: gtkpmbpl
1 Replies

5. Shell Programming and Scripting

IF awk in a while read line-loop

Hi As a newbe in scripting, i struggle hard with my first script. What i want to do is, bringing data of two files together. file1: .... 05/14/12-04:00:00 41253 4259 5135 5604 5812 5372 05/14/12-04:10:00 53408 5501 6592 7402 7354 6639 05/14/12-04:20:00 58748 6037 7292 8223... (13 Replies)
Discussion started by: IMPe
13 Replies

6. UNIX for Dummies Questions & Answers

read regex from ID file, print regex and line below from source file

I have a file of protein sequences with headers (my source file). Based on a list of IDs (which are included in some of the headers), I'd like to print out only the specified sequences, with only the ID as header. In other words, I'd like to search source.txt for the terms in IDs.txt, and print... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

7. Shell Programming and Scripting

Using awk instead of while loop to read file

Hello, I have a huge file, I am currently using while loop to read and do some calculation on it, but it is taking a lot of time. I want to use AWK to read and do those calculations. Please suggest. currently doing: cat input2 | while read var1 do num=`echo $var1 | awk... (6 Replies)
Discussion started by: anand2308
6 Replies

8. Shell Programming and Scripting

For loop inside awk to read and print contents of files

Hello, I have a set of files Xfile0001 - Xfile0021, and the content of this files (one at a time) needs to be printed between some line (lines start with word "Generated") that I am extracting from another file called file7.txt and all the output goes into output.txt. First I tried creating a for... (5 Replies)
Discussion started by: jaldo0805
5 Replies

9. Shell Programming and Scripting

Use while loop to read file and use ${file} for both filename input into awk and as string to print

I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix. I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice. Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

10. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies
XmFontList(library call)												  XmFontList(library call)

NAME
XmFontList -- Data type for a font list SYNOPSIS
#include <Xm/Xm.h> DESCRIPTION
XmFontList is the data type for a font list. A font list consists of font list entries. Each entry contains a font or a font set (a group of fonts) and is identified with a tag, which is optional. If this tag is NULL, the tag is set to XmFONTLIST_DEFAULT_TAG. The value of XmFONTLIST_DEFAULT_TAG is XmFONTLIST_DEFAULT_TAG_STRING. When a compound string is displayed, the font list element tag of the compound string segment is matched with a font list entry tag in the font list and the matching font list entry is used to display the compound string. A font list entry is chosen as follows: o The first font list entry whose tag matches the tag of the compound string segment is used. o If no match has been found and if the tag of the compound string segment is XmFONTLIST_DEFAULT_TAG, the first font list entry whose tag matches the tag that would result from creating an entry with XmSTRING_DEFAULT_CHARSET is used. For example, if creating an entry with XmSTRING_DEFAULT_CHARSET would result in the tag ISO8859-1, the compound string segment tag XmFONTLIST_DEFAULT_TAG matches the font list entry tag ISO8859-1. o If no match has been found and if the tag of the compound string segment matches the tag that would result from creating a segment with XmSTRING_DEFAULT_CHARSET, the first font list entry whose tag is XmFONTLIST_DEFAULT_TAG is used. o If no match has been found, the first entry in the font list is used. The font list interface consists of the routines listed in Related Information. Font lists are specified in resource files with the following syntax: resource_spec: font_entry [, font_entry ]+ The resource value string consists of one or more font list entries separated by commas. Each font_entry identifies a font or font set and an optional font list entry tag. A tag specified for a single font follows the font name and is separated by = (equals sign); otherwise, in a font set the tag is separated by a colon. The colon is required whether a tag is specified or not. A font entry uses the following syntax to specify a single font: font_name [ '=' tag ] For example, the following entry specifies a 10 point Times Italic font without a font list entry tag; *fontList: -Adobe-Times-Medium-I-Normal--10* A font entry containing a font set is similar, except a semicolon separates multiple font names and the specification ends with a colon followed by an optional tag: font_name [ ';' font_name ]+ ':' [ tag ] A font_name is an X Logical Font Description (XLFD) string and tag is any set of characters from ISO646IRV except space, comma, colon, equal sign and semicolon. Following is an example of a font set entry. It consists of three fonts (except for charsets), and an explicit font list entry tag. *fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG Note that the XmRenderTable is another data type that can be used for font lists. Refer to the XmRenderTable(3) for details. RELATED
XmFontListAdd(3), XmFontListAppendEntry(3), XmFontListCopy(3), XmFontListCreate(3), XmFontListEntryCreate(3), XmFontListEntryFree(3), XmFontListEntryGetFont(3), XmFontListEntryGetTag(3), XmFontListEntryLoad(3), XmFontListFree(3), XmFontListFreeFontContext(3), XmFontList- GetNextFont(3), XmFontListInitFontContext(3), XmFontListNextEntry(3), XmFontListRemoveEntry(3), XmRenderTable(3), and XmString(3). XmFontList(library call)
All times are GMT -4. The time now is 10:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy