Sponsored Content
Full Discussion: Search, and add if present
Top Forums Shell Programming and Scripting Search, and add if present Post 302887487 by Don Cragun on Saturday 8th of February 2014 02:18:46 AM
Old 02-08-2014
Quote:
Originally Posted by loba
Dear tukuyomi,

thank you for you help. The problem is that my item list contains a few hundred entries for each position. Meaning at position $7 I have over 400, at position $8 there are about 100 and $9 has > 800. Any idea how I could do this?
When we see one of your ~1300 values, how do we know whether it is supposed to go into field 7, 8, or 9?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search a word in a file present in tar file

i need to search a word in the tar file. if it is present just give me the file name please help me (1 Reply)
Discussion started by: junkbuster
1 Replies

2. Shell Programming and Scripting

search pattern present in second field

Hi All, I have a file with following list. example 1 ======== cat 1.txt -------- 0000cab4752c 0000dab47c2c ... ... ... Also i have another file 2.txt in which the data is in this format as shown: cat 2.txt ---------... (6 Replies)
Discussion started by: imas
6 Replies

3. UNIX for Dummies Questions & Answers

Search Pattern and add column

Hi, I have two files. file1 contents: aaa bbb ccc ddd eee fff ggg ddd www eee ggg dde qqq zzz hhh ddd file2 contents: mmm mmm mmm mmm Now I want to add file2 contents to end of lines in file1 where a line contains pattern "ddd" and it should look like this: file3 contents: aaa... (3 Replies)
Discussion started by: harjitsingh
3 Replies

4. Shell Programming and Scripting

Search a pattern and add new line below

Hi, I have 2 files like below. File A: apple mango File B: start abc def apple ghi end start cba fed (4 Replies)
Discussion started by: jayadanabalan
4 Replies

5. Shell Programming and Scripting

search for string and add the second line below

Hi there, i have an /etc/hosts file that is organised in sections, like this # # Oracle Servers # 1.1.1.1 boxa 2.2.2.2 boxb 9.9.9.9 boxj # # Prod Sybase Servers # 6.6.6.6 boxt 4.4.4.4 boxz I am just trying to write a line of code that will ill be able to pass the comment block... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

6. UNIX for Dummies Questions & Answers

Search and add the column in the file

Hi All, I have the Overview.csv file like below format Message ID Sendout Group Name Email Subject Name Type Rcpts Responses Response Rate Open Rate Click Rate 2000009723 01-22-2014 16:14 Test_GroupPQA2013 000123@yahoo.com INFO RISQUE D'INONDATION... (3 Replies)
Discussion started by: armsaran
3 Replies

7. UNIX for Dummies Questions & Answers

How to add to the search path - bin?

Hi, Now I have: /Users/okn/bin for my private shell scripts. How do I add /Users/okn/bin to my PATH? The PATH is right now: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin The .bash_profile doesn't state anything about a PATH (yet). I read about this: PATH=/bin:$PATH
 export PATH or... (1 Reply)
Discussion started by: OmarKN
1 Replies

8. Shell Programming and Scripting

Add comment if not present

I have a file cat /root/file #import node1 #import node2 import node2 import node4 After sed/awk operation the file should be as follows cat /root/file #import node1 #import node2 #import node2 #import node4 (6 Replies)
Discussion started by: anil510
6 Replies

9. Shell Programming and Scripting

Search a string in a file which is also present in another file in UNIX

Hi there, I am new to Unix and had below requirement to finish my task. I have file1.dat which has data as shown below. case1.txt case2.txt case3.txt case4.txt file1.dat has only file names I have folder which has above files mentioned in file1.dat ./all_files case1.txt... (6 Replies)
Discussion started by: raj028
6 Replies

10. UNIX for Beginners Questions & Answers

UNIX command to ignore replacing a search string if it is already present

Hello, I am searching the following string Folder^ in a file and replacing it with Folder^/ However if the file already contains Folder^/ I want to avoid replacing it with Folder^// To do this I have to do the following today: 1) echo "Folder^" | sed 's/Folder\^/Folder\^\//g' I get... (2 Replies)
Discussion started by: mehimadri12
2 Replies
Data::Pager(3pm)					User Contributed Perl Documentation					  Data::Pager(3pm)

NAME
Data::Pager - flexible data pager SYNOPSIS
use Data::Pager; my $pager = Data::Pager->new({ current => 100, perpage => 10, offset => 5, limit => 2000, }); #~ accessors: $pager->current; # 100 $pager->next; # 101 $pager->prev; # 99 $pager->limit; # 2000 $pager->start; # 1 # not typical start of a programmer $pager->final; # # 400 (which denotes 2000 / 5 pager links) $pager->end; # / $pager->from; # 495 (may serve in SQL LIMIT clause) $pager->to; # 500 (may serve in SQL LIMIT clause) $pager->list; # 95 96 97 98 99 100 101 102 103 104 105 DESCRIPTION
This class implements the familiar pager where the current position is centered. CONSTRUCTOR
new my $pager = Data::Pager->new({ current => 1, # this is the current pager position perpage => 10, # the pager consists of this number of links (defaults to 10) offset => 5, # this is the number of results (fetched from the DB for example) per result limit => 100, # how far is the pager allowed }); # sample output from html table: id ... ..... ... 1. ... ..... ... 2. ... ..... ... 3. ... ..... ... 4. ... ..... ... 5. ... ..... ... 1 2 3 4 5 6 7 8 9 10 Returns object or undef if current position is beyond the limit. METHODS
current $pager->current(); Returns the current pager position. set_current($digit) $pager->set_current(850); $pager->set_current(850)->next(); Sets the current pager position. Returns the pager object on succes, undef on false. next Returns the next pager position or undef if this is the last one. prev Returns the previous pager position or undef if this is the first one. start Returns 1 - the start pager position. end Returns the end pager position. first Returns the first pager position for this result set. last Returns the last pager position for this result set. from '1' => { 'to' => 5, 'next' => 2, 'prev' => undef, 'from' => 0 }, '2' => { 'to' => 10, 'next' => 3, 'prev' => 1, 'from' => 5 }, ... Returns the start result this pager position refers to. to Returns the end result this pager position refers to. list @_ = $pager->list; $_ = $pager->list; Returns the pager links for this result set. In list context returns the resulting list. In scalar context returns reference to the resulting list. # note the alignment $pager->set_current(10); print $pager->list; # 6 7 8 9 [10] 11 12 13 14 15 $pager->set_current(33); print $pager->list; # 28 29 30 31 32 [33] 34 35 36 37 38 SEE ALSO
Data::Page BUGS
What BUGS? AUTHOR
Vidul Nikolaev Petrov, vidul@cpan.org COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.10.0 2006-04-04 Data::Pager(3pm)
All times are GMT -4. The time now is 02:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy