Sponsored Content
Top Forums Shell Programming and Scripting Help/Advise on parsing these line of text Post 302759735 by Yoda on Tuesday 22nd of January 2013 09:35:36 PM
Old 01-22-2013
Code:
awk -F'[=|\(|\)]' '{
 for(i=1;i<NF;i++) {
  if($i=="PROGRAM") p=$(i+1);
  if($i=="HOST") h=$(i+1);
  if($i=="USER") u=$(i+1);
 }
 printf "Program: %s Host: %s User: %s\n", p,h,u;
} ' file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Parsing text from one line with shell scripts

Hi Gurus! I wonder if anyone can help me, I'm sure you guys can. I have a text file which contains a lot of data on the one line as follows: $ What I need to do is pull all of those id values out (eg 2549425) and write them to a list in a text file. Any help would be greatly... (3 Replies)
Discussion started by: th3g0bl1n
3 Replies

2. Shell Programming and Scripting

Parsing text from file

Any ideas? 1)loop through text file 2)extract everything between SOL and EOL 3)output files, for example: 123.txt and 124.txt for the file below So far I have: sed -n "/SOL/,/EOL/{p;/EOL/q;}" file Here is an example of my text file. SOL-123.go something goes here something goes... (0 Replies)
Discussion started by: ndnkyd
0 Replies

3. Shell Programming and Scripting

Perl question, parsing line by line

Hello, Im very new to PERL and as a project to work on developing my skills at PERL Im trying to parse poker hands. Ive tried many methods however I cant get the last step. $yourfile= 'FILENAME';#poker hands to parse open (FILE, "$yourfile") or die $!; @lines = <FILE>; for (@lines) ... (1 Reply)
Discussion started by: Ek0
1 Replies

4. Shell Programming and Scripting

Parsing text

Hello all, I have some text formatted as follows Name: John doe Company: Address 1: 7 times the headache Address 2: City: my city State/Province: confusion Zip/Postalcode: 12345 and I'm trying to figure out how I could extract the data after the colon so that the result would be ... (6 Replies)
Discussion started by: mcgrailm
6 Replies

5. Programming

Parsing a Text file using C++

I was trying to parse the text file, which will looks like this ###XYZABC#### ############ int = 4 char = 1 float = 1 . . ############ like this my text file will contains lots of entries and I need to store these entries in the map eg. map.first = int and map.second = 4 same way I... (5 Replies)
Discussion started by: agupta2
5 Replies

6. UNIX for Dummies Questions & Answers

Parsing file, reading each line to variable, evaluating date/time stamp of each line

So, the beginning of my script will cat & grep a file with the output directed to a new file. The data I have in this file needs to be parsed, read and evaluated. Basically, I need to identify the latest date/time stamp and then calculate whether or not it is within 15 minutes of the current... (1 Reply)
Discussion started by: hynesward
1 Replies

7. Shell Programming and Scripting

Parsing and filtering multiline text into comma separated line

I have a log file that contains several reports with following format. <Start of delimiter> Report1 header Report1 header continue Report1 header continue Record1 header Record1 header continue Record1 header continue field1 field2 field3 field4 ------... (1 Reply)
Discussion started by: yoda9691
1 Replies

8. Shell Programming and Scripting

Parsing text file

Hi Friends, I am back for the second round today - :D My input text file is this way Home friends friendship meter Tools Mirrors Downloads My Data About Us Help My own results BLAT Search Results ACTIONS QUERY SCORE START END QSIZE IDENTITY CHRO STRAND ... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

9. Shell Programming and Scripting

Parsing blocked text

I do have a flat text file that are divided into blocks. Each block is demimited by '='. I would like to parse certain numbers and letters. This is the format of the file I have. It has thousands of such blocks >A B 1, 100 TTTT 100 95 >C D 1, 95 GHJKL = >A B 1, 72 GHUJKLO 72 84 >C D... (3 Replies)
Discussion started by: Kanja
3 Replies

10. Shell Programming and Scripting

Text parsing

Hi All! Is it possible to convert text file: to: ? (6 Replies)
Discussion started by: y77
6 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy