Sponsored Content
Top Forums Shell Programming and Scripting How to parse a file for text b/n double quotes? Post 302460928 by clx on Friday 8th of October 2010 03:02:04 AM
Old 10-08-2010
If you could put the message without newline ( let it be exceeds the line width ) it should work.
Is is acceptable for you?

something like..

Code:
# Comments
     .
     .
     .
 
Some lines
 
MY_BANNER_SSHD=""
WARNING_MESSAGE="some text"
WARNING_MESSAGE="some text which is too long too fit in single linesome text which is too long too fit in single line some text which is too long too fit in single line some text which is too long too fit in single line"
 
# Comments


Please let us know if you want to stick with your current format.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Double quotes or single quotes when using ssh?

I'm not very familiar with the ssh command. When I tried to set a variable and then echo its value on a remote machine via ssh, I found a problem. For example, $ ITSME=itsme $ ssh xxx.xxxx.xxx.xxx "ITSME=itsyou; echo $ITSME" itsme $ ssh xxx.xxxx.xxx.xxx 'ITSME=itsyou; echo $ITSME' itsyou $... (3 Replies)
Discussion started by: password636
3 Replies

2. Shell Programming and Scripting

Parse comma delimited and optionally quotes dimilited file

Hi, Can you please help me? How to Parse a comma delimited and optionally quotes dimilited file? sample.dat ---------- "I",+2007,"SANDA, 20, MARTIN PLACE","SANDA 20MARTIN" "D",+2008,"RANDA, 22, MARTIN PLACE","RANDA 22MARTIN" Thank you. Ram (8 Replies)
Discussion started by: vramana2003
8 Replies

3. UNIX for Dummies Questions & Answers

Removing double quotes in a file

Hi All, I have a tab delimited file where each of the strings have double quotes. The problem is that I have records which are in the following format: "TEXAS" ""HOUSTON"" "123" "" "2625-39-39" ""MAINE"" "" "456" "I" "3737-39-82" I would have to output... (3 Replies)
Discussion started by: kingofprussia
3 Replies

4. UNIX for Dummies Questions & Answers

grep single quotes or double quotes

Unix superusers, I am new to unix but would like to learn more about grep. I am very familiar with regular expressions as i have used them for searching text files in windows based text editors. Since I am not very familiar with Unix, I dont understand when one should use GREP with the... (2 Replies)
Discussion started by: george_vandelet
2 Replies

5. Shell Programming and Scripting

awk, comma as field separator and text inside double quotes as a field.

Hi, all I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes. sample input: for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Discussion started by: kevintse
8 Replies

6. Shell Programming and Scripting

File with double quotes

I have one file a.txt as below. a.txt "aaas","111111","ewwee32e","deee333", "aaas","111111","ewwee32e","deee333", "aaas","111111","ewwee32e","deee333", "aaas","111111","ewwee32e","deee333", I want to write a script to process a.txt and want the output as below in different file as below -... (2 Replies)
Discussion started by: ravigupta2u
2 Replies

7. Shell Programming and Scripting

Issue with Single Quotes and Double Quotes for prompt PS1

Hi, Trying to change the prompt. I have the following code. export PS1=' <${USER}@`hostname -s`>$ ' The hostname is not displayed <abc@`hostname -s`>$ uname -a AIX xyz 1 6 00F736154C00 <adcwl4h@`hostname -s`>$ If I use double quotes, then the hostname is printed properly but... (3 Replies)
Discussion started by: bobbygsk
3 Replies

8. Shell Programming and Scripting

Replace Double quotes within double quotes in a column with space while loading a CSV file

Hi All, I'm unable to load the data using sql loader where there are double quotes within the double quotes As these are optionally enclosed by double quotes. Sample Data : "221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22" Refurbished - Airwave","Supply... (6 Replies)
Discussion started by: mlavanya
6 Replies

9. Shell Programming and Scripting

awk to parse comma separated field and removing comma in between number and double quotes

Hi Experts, Please support I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6. ... (3 Replies)
Discussion started by: as7951
3 Replies

10. Shell Programming and Scripting

awk -File contain double quotes

Hi ALL, file data like : test.csv a,b,"c,d" my awk version is 4.0.2 ,if i am using the below code is working fine. awk -vFPAT='(*)|("+")' -vOFS="," '{print $3}' test.csv if the awk version is 3.1.7 is not working . Could you please help me on this one. output should be : "c,d" (6 Replies)
Discussion started by: bmk123
6 Replies
Tk_MeasureChars(3)					       Tk Library Procedures						Tk_MeasureChars(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars - routines to measure and display simple single-line strings. SYNOPSIS
#include <tk.h> int Tk_MeasureChars(tkfont, string, numBytes, maxPixels, flags, lengthPtr) int Tk_TextWidth(tkfont, string, numBytes) Tk_DrawChars(display, drawable, gc, tkfont, string, numBytes, x, y) Tk_UnderlineChars(display, drawable, gc, tkfont, string, x, y, firstByte, lastByte) ARGUMENTS
Tk_Font tkfont (in) Token for font in which text is to be drawn or measured. Must have been returned by a previous call to Tk_GetFont. const char *string (in) Text to be measured or displayed. Need not be null terminated. Any non-printing meta-characters in the string (such as tabs, newlines, and other control characters) will be measured or displayed in a plat- form-dependent manner. int numBytes (in) The maximum number of bytes to consider when measuring or drawing string. Must be greater than or equal to 0. int maxPixels (in) If maxPixels is >= 0, it specifies the longest permissible line length in pixels. Characters from string are processed only until this many pixels have been covered. If maxPixels is < 0, then the line length is unbounded and the flags argument is ignored. int flags (in) Various flag bits OR-ed together: TK_PARTIAL_OK means include a character as long as any part of it fits in the length given by maxPixels; otherwise, a character must fit completely to be considered. TK_WHOLE_WORDS means stop on a word boundary, if possible. If TK_AT_LEAST_ONE is set, it means return at least one character even if no characters could fit in the length given by maxPixels. If TK_AT_LEAST_ONE is set and TK_WHOLE_WORDS is also set, it means that if not even one word fits on the line, return the first few letters of the word that did fit; if not even one letter of the word fit, then the first letter will still be returned. int *lengthPtr (out) Filled with the number of pixels occupied by the number of characters returned as the result of Tk_Mea- sureChars. Display *display (in) Display on which to draw. Drawable drawable (in) Window or pixmap in which to draw. GC gc (in) Graphics context for drawing characters. The font selected into this GC must be the same as the tkfont. int x, y (in) Coordinates at which to place the left edge of the baseline when displaying string. int firstByte (in) The index of the first byte of the first character to underline in the string. Underlining begins at the left edge of this character. int lastByte (in) The index of the first byte of the last character up to which the underline will be drawn. The charac- ter specified by lastByte will not itself be underlined. _________________________________________________________________ DESCRIPTION
These routines are for measuring and displaying simple single-font, single-line strings. To measure and display single-font, multi-line, justified text, refer to the documentation for Tk_ComputeTextLayout. There is no programming interface in the core of Tk that supports multi-font, multi-line text; support for that behavior must be built on top of simpler layers. Note that the interfaces described here are byte-oriented not character-oriented, so index values coming from Tcl scripts need to be converted to byte offsets using the Tcl_UtfAtIndex and related routines. A glyph is the displayable picture of a letter, number, or some other symbol. Not all character codes in a given font have a glyph. Char- acters such as tabs, newlines/returns, and control characters that have no glyph are measured and displayed by these procedures in a plat- form-dependent manner; under X, they are replaced with backslashed escape sequences, while under Windows and Macintosh hollow or solid boxes may be substituted. Refer to the documentation for Tk_ComputeTextLayout for a programming interface that supports the platform-inde- pendent expansion of tab characters into columns and newlines/returns into multi-line text. Tk_MeasureChars is used both to compute the length of a given string and to compute how many characters from a string fit in a given amount of space. The return value is the number of bytes from string that fit in the space specified by maxPixels subject to the conditions described by flags. If all characters fit, the return value will be numBytes. *lengthPtr is filled with the computed width, in pixels, of the portion of the string that was measured. For example, if the return value is 5, then *lengthPtr is filled with the distance between the left edge of string[0] and the right edge of string[4]. Tk_TextWidth is a wrapper function that provides a simpler interface to the Tk_MeasureChars function. The return value is how much space in pixels the given string needs. Tk_DrawChars draws the string at the given location in the given drawable. Tk_UnderlineChars underlines the given range of characters in the given string. It does not draw the characters (which are assumed to have been displayed previously by Tk_DrawChars); it just draws the underline. This procedure is used to underline a few characters without hav- ing to construct an underlined font. To produce natively underlined text, the appropriate underlined font should be constructed and used. SEE ALSO
font(n), FontId(3) KEYWORDS
font, measurement Tk 8.1 Tk_MeasureChars(3)
All times are GMT -4. The time now is 09:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy