Sponsored Content
Top Forums Shell Programming and Scripting awk - Multi-line data to be stored in variable Post 302971455 by chill3chee on Wednesday 20th of April 2016 10:51:05 AM
Old 04-20-2016
Hi MadeinGermany,
The NR is same for both the FS="@"and FS="[@]" However the NF differs in the above cases; as you specified for FS="@"it is treating line feeds as a delimiter. Thanks again
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK Multi-Line Records Processing

I am an Awk newbie and cannot wrap my brain around my problem: Given multi-line records of varying lengths separated by a blank line I need to skip the first two lines of every record and extract every-other line in each record unless the first line of the record has the word "(CONT)" in the... (10 Replies)
Discussion started by: RacerX
10 Replies

2. Shell Programming and Scripting

AWK Multi-Line Records Numbering Problem

I have a set of files of multi-line records with the records separated by a blank line. I needed to add a record number to the front of each line followed by a colon and did the following: awk 'BEGIN {FS = "\n"; RS = ""}{for (i=1; i<=NF; i++)print NR,":",$i}' ~/Desktop/data98-1-25.txt >... (3 Replies)
Discussion started by: RacerX
3 Replies

3. Shell Programming and Scripting

how to get the string stored in a variable in a line???

Hi all, I want to search for a data type in a line.For this in a loop i am checking for $DATA_TYPE in a line using grep.But grep is not able to find when i give this. Can any one tell me how to check string in $DATA_TYPE variable in line usign grep (or) any other way to do the above task. ... (4 Replies)
Discussion started by: jisha
4 Replies

4. Shell Programming and Scripting

Manipulating Pick multi dimensional data with awk.

Hi. I am reasonably new to awk, but have done quite a lot of unix scripting in the past. I have resolved the issues below with unix scripting but it runs like a dog. Moved to awk for speed and functionality but running up a big learning curve in a hurry, so hope there is some help here. I... (6 Replies)
Discussion started by: mike.strategis
6 Replies

5. Shell Programming and Scripting

AWK: pattern not properly stored in variable?

Hey there, I have a table of contents file of the form 1 Title1 1.1 Subtitle1 1.1.1 Subsubtitle1 1.1.2 Subsubtitle2 ... and want to count the number of dots in the first field to find out the level of the section. I use the gsub function for the job, which works if I pass the pattern... (2 Replies)
Discussion started by: herrsimon
2 Replies

6. Shell Programming and Scripting

Multi line variable script... needs help.

I am trying to write a script that will help me put a file into excel with little manipulation. Below is a sample of the file im using. Group1:*:gid1:user,user Group2:*:gid2:user,user Group3:*:gid3:user,user,user,user,user,user,user Group4:*:gid4:user,user I marked in red the part that is... (1 Reply)
Discussion started by: rookieuxixsa
1 Replies

7. UNIX for Dummies Questions & Answers

How Do I Create A Multi Line Menu Variable?

I want something that would show up basically like: Menu ----- 1) Option 1 2) Option 2 3) Option 3 Pick one: I tried menu = " Menu \r\n ----- \r\n 1)Option 1 \r\n..............etc etc etc" but that didnt work (just got the whole menu one one line, with the... (2 Replies)
Discussion started by: SoVi3t
2 Replies

8. Shell Programming and Scripting

Multi-line filtering based on multi-line pattern in a file

I have a file with data records separated by multiple equals signs, as below. ========== RECORD 1 ========== RECORD 2 DATA LINE ========== RECORD 3 ========== RECORD 4 DATA LINE ========== RECORD 5 DATA LINE ========== I need to filter out all data from this file where the... (2 Replies)
Discussion started by: Finja
2 Replies

9. Shell Programming and Scripting

awk - Multiple files - 1 file with multi-line data

Greetings experts, Have 2 input files, of which 1 file has 1 record per line; in 2nd file, multiple lines constitute 1 record; Hence declared the RS=";" Now in the first file which ends with ";" at each line of the line; But \nis also being considered as part of the data due to which I am... (1 Reply)
Discussion started by: chill3chee
1 Replies

10. Shell Programming and Scripting

awk to lookup stored variable in file and print matching line

The bash bash below extracts the oldest folder from a directory and stores it in filename That result will match a line in bold in input. In the matching line there is an_xxx digit in italics that (once the leading zero is removed) will match a line in link. That is the lint to print in output.... (2 Replies)
Discussion started by: cmccabe
2 Replies
WebService::YouTube::Feeds(3pm) 			User Contributed Perl Documentation			   WebService::YouTube::Feeds(3pm)

NAME
WebService::YouTube::Feeds - Perl interface to YouTube RSS Feeds VERSION
This document describes WebService::YouTube::Feeds version 1.0.3 SYNOPSIS
use WebService::YouTube::Feeds; my $feeds = WebService::YouTube::Feeds->new( { ua => '...' } ); my @videos = $feeds->tag($tag); my @videos = $feeds->user($user); my @videos = $feeds->recently_added; my @videos = $feeds->recently_featured; my @videos = $feeds->top_favorites; my @videos = $feeds->top_rated; my @videos = $feeds->most_discussed_month; my @videos = $feeds->most_discussed_today; my @videos = $feeds->most_discussed_week; my @videos = $feeds->top_viewed; my @videos = $feeds->top_viewed_month; my @videos = $feeds->top_viewed_today; my @videos = $feeds->top_viewed_week; DESCRIPTION
This is a Perl interface to YouTube RSS Feeds. See About RSS <http://youtube.com/rssls> for details. SUBROUTINES
/METHODS new( \%fields ) Creates and returns a new WebService::YouTube::Feeds object. %fields can contain parameters enumerated in "ACCESSORS" section. parse_rss($rss) Parses RSS and returns the result. $rss should be an object that XML::Simple can understand. tag( $tag ) Returns an array of WebService::YouTube::Video object. $tag is a keyword string separated by a space. See <http://youtube.com/rssls> for details. user( $user ) Returns an array of WebService::YouTube::Video object. $user is an username. See <http://youtube.com/rssls> for details. recently_added( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. recently_featured( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. top_favorites( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. top_rated( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. most_discussed_month( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. most_discussed_today( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. most_discussed_week( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. top_viewed( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. top_viewed_month( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. top_viewed_today( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. top_viewed_week( ) Returns an array of WebService::YouTube::Video object. See <http://youtube.com/rssls> for details. ACCESSORS ua LWP::UserAgent object DIAGNOSTICS
CONFIGURATION AND ENVIRONMENT
WebService::YouTube::Feeds requires no configuration files or environment variables. DEPENDENCIES
HTTP::Date, LWP::UserAgent, XML::Simple, WebService::YouTube::Util, WebService::YouTube::Video INCOMPATIBILITIES
None reported. BUGS AND LIMITATIONS
No bugs have been reported. Please report any bugs or feature requests to "bug-webservice-youtube@rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-YouTube>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. AUTHOR
Hironori Yoshida <yoshida@cpan.org> LICENSE AND COPYRIGHT
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. perl v5.10.1 2010-08-01 WebService::YouTube::Feeds(3pm)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy