Sponsored Content
Top Forums Shell Programming and Scripting Extract specific data content from a long list of data Post 302378924 by ghostdog74 on Wednesday 9th of December 2009 05:27:07 AM
Old 12-09-2009
if you want to add a newline, just do printf with \n. i will leave it to you to do that.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract data into file with specific field specs

:confused: I have a tab delimited file that I need to extract data from and into a file with specific field specs. Each field has to be a certain amount of characters. So, the name field (from delimited file) might have only 15 characters but needs to be 25 (in new file) so I need to insert spaces... (5 Replies)
Discussion started by: criddel
5 Replies

2. Shell Programming and Scripting

Shell script or command help to extract specific contents from a long list of content

Hi, I got a long list of contents: >sequence_1 ASSSSSSSSSSSDDDDDDDDDDDCCCCCCC ASDSFDFFDFDFFWERERERERFSDFESFSFD >sequence_2 ASDFDFDFFDDFFDFDSFDSFDFSDFSDFDSFASDSADSADASD ASDFFDFDFASFASFASFAFSFFSDASFASFASFAFS >sequence_3 VEDFGSDGSDGSDGSDGSDGSDGSDG dDFSDFSDFSDFSDFSDFSDFSDFSDF... (2 Replies)
Discussion started by: patrick87
2 Replies

3. Shell Programming and Scripting

Extract all the content after a specific data

My input: >seq_1 DSASSTRRARRRRTPRTPSLRSRRSDVTCS >seq_3 RMRLRRWRKSCSERS*RRSN >seq_8 RTTGLSERPRLPTTASRSISSRWTR >seq_10 NELPLEKGSLDSISIE >seq_9 PNQGDAREPQAHLPRRQGPRDRPLQAYA+ QVQHRRHDHSRTQH*LCRRRQREDCDRLHR >seq_4 DRGKGQAGCRRPQEGEALVRRCS>seq_6 FA*GLAAQDGEA*SGRG My output: Extract all... (22 Replies)
Discussion started by: patrick87
22 Replies

4. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

5. Shell Programming and Scripting

Extract specific read from a data

Input file: #abc_1 SAASFASFGGDSGDSGDSGSDGSDGSDGSDGSDGSDGSDGDS Output file: FASFGGDSGDS I just want to print out the read from position 5 until position 15 from the data. Below is the code that I just try but it is failed to get my desired output: grep -v '#' input_file | awk... (5 Replies)
Discussion started by: patrick87
5 Replies

6. Shell Programming and Scripting

Extract specific content from data and rename its header problem asking

Input file 1: >pattern_5 GAATTCGTTCATGTAGGTTGASDASFGDSGRTYRYGHDGSDFGSDGGDSGSDGSDFGSDF ATTTAATTATGATTCATACGTCATATGTTATTATTCAATCGTATAAAATTATGTGACCTT SDFSDGSDFKSDAFLKJASLFJASKLFSJAKJFHASJKFHASJKFHASJKFHSJAKFHAW >pattern_1 AAGTCTTAAGATATCACCGTCGATTAGGTTTATACAGCTTTTGTGTTATTTAAATTTGAC... (10 Replies)
Discussion started by: patrick87
10 Replies

7. Shell Programming and Scripting

Extract specific data and change its arrangment

Input: HS04636 PROGRAM source 836 7001 + ID=g1 HS04636 PROGRAM beginner 836 7001 + ID=g1.t1;Parent=g1 HS04636 PROGRAM position 836 836 + Parent=g1.t1 HS04636 PROGRAM type 836 1017 + Parent=g1.t1 HS04636 ... (2 Replies)
Discussion started by: patrick87
2 Replies

8. HP-UX

How to extract data for a specific process from ovpa?

Hi Friends, One question. Supposed I want to extract data only for process named "sqlplus" how can I do it. Any suggestions? I don't want all the data as it is not useful to me e.g.. Command I use is given below extract -xp -p -r repfile -b"03/15/13 7:00 PM" -e"03/15/13 09:30 PM" -f... (1 Reply)
Discussion started by: kunwar
1 Replies

9. Shell Programming and Scripting

How to extract specific data?

Bash scripting beginner here... I have many folders, each folder representing one subject. Not all subjects have all the required files, so I need to somehow cycle through all the data and then extract the data only from subjects who have no files missing. I tried to output the ls command, but... (4 Replies)
Discussion started by: LeftoverStew
4 Replies

10. Shell Programming and Scripting

How-To Extract specific data from a file.

data.txt has several information like the below.. <SERVER>:WEB:MYDOM01:/tmp/cong/MYDOM01,/tmp/app/MYDOM01 <WEBER>:CANES:https-web01,https-web02:/web/apps/https-web01/config <SERVER>:WEB:MYDOM07:/tmp/cong/MYDOM07,/tmp/app/MYDOM07... (7 Replies)
Discussion started by: mohtashims
7 Replies
Data::FormValidator::Filters(3pm)			User Contributed Perl Documentation			 Data::FormValidator::Filters(3pm)

NAME
Data::FormValidator::Filters - Basic set of filters available in an Data::FormValidator profile. SYNOPSIS
use Data::FormValidator; %profile = ( filters => 'trim', ... ); my $results = Data::FormValidator->check( \%data, \%profile ); DESCRIPTION
These are the builtin filters which may be specified as a name in the filters, field_filters, and field_filter_regexp_map parameters of the input profile. Filters are applied as the first step of validation, possibly modifying a copy of the validation before any constraints are checked. RECOMMENDED USE
As a long time maintainer and user of Data::FormValidator, I recommend that filters be used with caution. They are immediately modifying the input provided, so the original data is lost. The few I recommend include "trim", which removes leading and trailing whitespace. I have this turned on by default by using CGI::Application::Plugin::ValidateRM. It's also generally safe to use the "lc" and "uc" filters if you need that kind of data transformation. Beyond simple filters, I recommend transforming the "valid" hash returned from validation if further changes are needed. PROCEDURAL INTERFACE
You may also call these functions directly through the procedural interface by either importing them directly or importing the whole :filters group. For example, if you want to access the trim function directly, you could either do: use Data::FormValidator::Filters (qw/filter_trim/); # or use Data::FormValidator::Filters (qw/:filters/); $string = filter_trim($string); Notice that when you call filters directly, you'll need to prefix the filter name with "filter_". THE FILTERS
FV_split use Data::FormValidator::Filters qw(FV_split); # Validate every e-mail in a comma separated list field_filters => { several_emails => FV_split(qr/s*,s*/), # Any pattern that can be used by the 'split' builtin works. tab_sep_field => FV_split(' '), }, constraint_methods => { several_emails => email(), }, With this filter, you can split a field into multiple values. The constraint for the field will then be applied to every value. This filter has a different naming convention because it is a higher-order function. Rather than returning a value directly, it returns a code reference to a standard Data::FormValidator filter. After successfully being validated the values will appear as an arrayref. FV_replace use Data::FormValidator::Filters qw(FV_replace); field_filters => { first_name => FV_replace(qr/Mark/,'Don'), }, FV_replace is a shorthand for writing simple find-and-replace filters. The above filter would be translated to this: sub { my $v = shift; $v =~ s/Mark/Don/; $v } For more complex filters, just write your own. trim Remove white space at the front and end of the fields. strip Runs of white space are replaced by a single space. digit Remove non digits characters from the input. alphanum Remove non alphanumeric characters from the input. integer Extract from its input a valid integer number. pos_integer Extract from its input a valid positive integer number. Bugs: This filter won't extract "9" from "a9+", it will instead extract "9+" neg_integer Extract from its input a valid negative integer number. Bugs: This filter will currently filter the case of "a9-" to become "9-", which it should leave it alone. decimal Extract from its input a valid decimal number. Bugs: Given "1,000.23", it will currently return "1.000.23" pos_decimal Extract from its input a valid positive decimal number. Bugs: Given "1,000.23", it will currently return "1.000.23" neg_decimal Extract from its input a valid negative decimal number. Bugs: Given "1,000.23", it will currently return "1.000.23" dollars Extract from its input a valid number to express dollars like currency. Bugs: This filter won't currently remove trailing numbers like "1.234". phone Filters out characters which aren't valid for an phone number. (Only accept digits [0-9], space, comma, minus, parenthesis, period and pound [#].) sql_wildcard Transforms shell glob wildcard (*) to the SQL like wildcard (%). quotemeta Calls the quotemeta (quote non alphanumeric character) builtin on its input. lc Calls the lc (convert to lowercase) builtin on its input. uc Calls the uc (convert to uppercase) builtin on its input. ucfirst Calls the ucfirst (Uppercase first letter) builtin on its input. SEE ALSO
o L<Data::FormValidator> o L<Data::FormValidator::Constraints> o L<Data::FormValidator::Filters::Image> - shrink incoming image uploads AUTHOR
Author: Francis J. Lacoste <francis.lacoste@iNsu.COM> Maintainer: Mark Stosberg <mark@summersault.com> COPYRIGHT
Copyright (c) 1999,2000 iNsu Innovations Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms as perl itself. perl v5.14.2 2011-11-25 Data::FormValidator::Filters(3pm)
All times are GMT -4. The time now is 07:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy